I know that a function key is a single key, but touch-typists might find
it faster to map it to something like <leader>zz so they don't have to
actually take their hands off the home keys to get to the mapping.

I've set the leader on my system to the comma instead of the backslash,
so it's even faster for me to hit ,zz (which I can do without looking)
than to look at the keyboard while I move my hand off the home keys to
get to the function key.

Here's another one I use (not mine, but I'm afraid I don't remember who
suggested it) occasionally:

map <silent> <Leader>zz :let &scrolloff=999-&scrolloff<CR>:set
scrolloff?<cr>

Hitting \zz (or ,zz for me) changes the scrolloff to a really large
number (well, it toggles between the large number and the original
value, which for me is 3).  The behaviour?  The cursor line is always
smack in the middle of the screen.  Hitting \zz again restores the
original behaviour.

Hope this helps,

Salman.

> -----Original Message-----
> From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 04, 2007 11:28 AM
> To: shawn bright
> Cc: vimlist
> Subject: Re: question about insert mode and zz
> 
> shawn bright wrote:
> > Hey there all,
> > i really dig the zz function to get me in the middle of the screen.
> > i was wondering if there were an insert mode ability to do 
> the same thing.
> > So if i am writing a long function and get to the bottom of 
> the screen 
> > i can move where i am at to the middle of the screen while still in 
> > insert mode?
> > 
> > thanks for any tips
> > shawn
> > 
> 
> Ctrl-O zz
> 
> see ":help i_CTRL-O" (that's control-oh, not control-zero).
> 
> Or if you're lazy:
> 
>       :imap <F9> <C-O>zz
> 
> then F9 does it.
> 
> 
> Best regards,
> Tony.
> --
> The years of peak mental activity are undoubtedly between the 
> ages of four and eighteen.  At four we know all the 
> questions, at eighteen all the answers.
> 

Reply via email to