I personally prefer `set scrolloff=999` which ensures the cursor is always in the vertical middle of the screen - this helps me always see the context of the current line.
On a widescreen I sometimes setup a file in multiple vertically-split windows, offset by one page, with scrollbind turned on. With scrolloff=999 I can now set 2 or 3 or 4 screenfuls of context around the current line.
That's a good one.
These make it so the next time you hit 'n' to continue a search, it centers the screen around the result.
" Mappings to keep the cursor in the middle of the screen most the time {{{
nmap n nmzz.`z
nmap N Nmzz.`z
nmap * *mzz.`z
nmap # #mzz.`z
nmap g* g*mzz.`z
nmap g# g#mzz.`z
"}}}
Re:Coming home to Vim
by parenthesis on Friday August 20, 2010 @06:57AM
(#1620054)
z<enter>, z. and z- work for this too.
"zt, zb and zz are commands that I use pretty frequently. They keep the cursor on the current line, but re-position the cursor at the top, bottom or middle of the screen."
Priceless! Was wondering how to do this a couple of days ago. Thanks David Frey.