News for hackers. Stuff that matters.
Re:Coming home to Vim by vijaydev on Friday August 20, 2010 @03:56AM (#1619810)
One of the comments in the article.

"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.

Re:Coming home to Vim by swaroop on Friday August 20, 2010 @04:01AM (#1619820)
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.
Re:Coming home to Vim by akkartik on Friday August 20, 2010 @12:41PM (#1620853)
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.
Re:Coming home to Vim by vijaydev on Friday August 20, 2010 @04:07AM (#1619826)
That's a good one.
Re:Coming home to Vim by cschneid on Friday August 20, 2010 @11:36AM (#1620659)
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.
Re:Coming home to Vim by graywh on Friday August 20, 2010 @09:23AM (#1620308)
Except that they also move the cursor to the first non-blank character on the line. In other words, z<CR> is like zt^, etc.