Thursday, March 29, 2012

Re: Still puzzling ove paste

On 18:31 Thu 29 Mar , howard Schwartz wrote:
> Still puzzling over disabling abbreviations in : command line mode. Not even
> sure of the terminology. In normal mode, hitting / ? or : puts you on the
> bottom of the screen, where you can execute 3 kinds of commands: / is a
> forward search ? is a backward search and : permits a special set of commands,
> partially left over from the old ed and ex editors. Then there is `ex'
> command line mode, which lets you execute more than one of these commands,
> before returning to normal or insert mode.
>
> It seems so reasonable to distinguish the : commands from the / and ? search
> commands. But there are no autocommands, or types of map or appreviations that
> do this. ``command line'' mode usually means all three of : / and ?
>
> I guess I could do something like this:
>
> map ^K :
> map : :set paste^M^K "using ^K to prevent infinite regress
>
> au insertEnter * set nopaste
>
>
> But then I would need to create maps for / and ? to set nopaste for these
> modes, in case someone when from a : command and then tried a search.
>
> Seems terribly messy. what I need is for entering : command mode to be an
> event, so I can use autocommands for it, like I could for cmdwin:
>
> au cmdwinEnter * set paste
> au cmdwinLeave * set nopaste
>
> Is there some obscure function that would permit me to use autocommands or
> maps that trigger when one enters and leaves : mode?
>
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Sure there are functions to do that, see ':help command-line-functions', in
particular ':help getcmdtype()'.

Best,
Marcin

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: