Wednesday, June 18, 2008

Quick Redraw

You can use z. in Vim to quickly redraw the current cursor line at the center of the window. zt redraws at the top and zb redraws at the bottom. Thanks to Nate for the tip!

2 comments:

Anonymous said...

zt, zz, and zb move the cursor line to the top, middle, and bottom of the screen respectively, leaving the cursor at its current position in the line.

Personally, I prefer these to z<CR>, z., and z-, which move the cursor line to the top, middle, and bottom, but put the cursor at the first non-blank character of the line.

Travis Whitton said...

Thanks for the more mnemonically friendly additions to the original comment. z<CR> is definitely nice and will probably become part of my regular repertoire.