3 ms·
Quick pro tip for zz, I pair zz with search/jumps, so the next match/jump location ends up centered. Edit: more elegant solution https://news.ycombinator.com/i
by pawelduda 4y ago
Quick pro tip for zz, I pair zz with search/jumps, so the next match/jump location ends up centered.
Edit: more elegant solution https://news.ycombinator.com/item?id=34308688 https://news.ycombinator.com/item?id=34308688
" Center screen on next/previous selection.
nmap n /<CR>zz
nmap N ?<CR>zz
" Last and next jump should center too.
nnoremap <C-o> <C-o>zz
nnoremap <C-i> <C-i>zz
- vault 4y agoThe source you copied this from offers a simpler version: " Center screen on next/previous selection. nnoremap n nzz nnoremap N Nzz " Last and next jump should center too. nnoremap <C-o> <C-o>zz nnoremap <C-i> <C-i>zz
- pawelduda 4y agoI copied it from my vimrc, I don't recall after many years where it came from :)
- 2mur 4y agoI pair it with half-page ups/downs. The cursor is always on the center line for easier vertical movements after scrolling nnoremap <C-d> <C-d>zz nnoremap <C-u> <C-u>zz
- fleekonpoint 4y agoVery cool!