Tim Chase schrieb:
> Generally, folks would get fired for writing stunts like the following,
> so read with caution...
> 
> Archived here:
> http://permalink.gmane.org/gmane.editors.vim/38930
> 
> you'll find these two lines from my post:
> 
> nnoremap / :exec('cnoremap <'.'cr> <'.'cr>:exec("cunmap
> <"."cr>")<'.'cr>:call HighlightCurrentSearch()<'.'cr>')<cr>/
> 
> nnoremap ? :exec('cnoremap <'.'cr> <'.'cr>:exec("cunmap
> <"."cr>")<'.'cr>:call HighlightCurrentSearch()<'.'cr>')<cr>?
> 
> They are hideous monstrosities, that don't quite do all that I
> described in my previous post. The basic gist is that you want to
> remap the "/" and "?" keys so that when you press them, you
> create a cnoremap mapping that maps the <cr> (and, unimplemented
> in this example, also <esc> and <c-c>) to perform the action
> "cunmap the <cr> mapping, and then do my custom action".
> 
> In this case, the custom action was to call the
> HighlightCurrentSearch() function defined in the post, as desired
> by the OP.  In your case, you'd want to tweak it to do a "zz"
> instead.
> 
> Caveat Vimtor...if it breaks, you get to keep both pieces.  If it
> kicks your dog, drinks your beer, steals your girlfriend, wrecks your
> pickup-truck, or any other tragedy found in country-music, I take no
> responsibility...it's an ugly hack.  YMMV.
> 
> -tim

A version using "<lt>":

:nnoremap / :cno <lt>cr> <lt>cr>zz:cun <lt>lt>cr><lt>cr><cr>/

Hints:
The mapping defined within the above RHS is
:cno <cr> <cr>zz:cun <lt>cr><cr>

And there is one more level of nesting
:cun <cr>


Andy

                
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Reply via email to