4 ms·
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 cur
by vijaydev 16y ago
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.
- swaroop 16y agoI 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.
- parenthesis 16y agoz<enter>, z. and z- work for this too.
- graywh 16y agoExcept that they also move the cursor to the first non-blank character on the line. In other words, z<CR> is like zt^, etc.
- cschneid 16y agoThese 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 "}}}