Is there a way to center the line I'm editing in the screen? This is sometimes needed to see a bit more context above and below the current line.
zz commands will recenter the line the cursor is on.
z. also moves the cursor to the first non-whitespace character in the line, while
zz keeps the cursor where it is.
There are similar commands for the top (
zt) and bottom (
zb) of the window.
The versions of these commands that end in a letter keep the cursor column, while the ones ending in punctuation move the cursor.
zz to center the current line in the screen:
Yes, in normal mode you can use
zz to do so. But as the docs forewarn, be careful with capslock as
ZZ will write the buffer to file and quit.
In normal mode,
zz will move the line currently under the cursor to the center of the screen.