Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #281 - Stateful zz

Created: July 11, 2002 11:51 Complexity: basic Author: Bob van Manen Version: 5.7 Karma: 16/7 Imported from: Tip#281

Do you find yourself hitting 'zz' all the time in order to see some context of what you're

currently working on? If so, then this tip might be for you. If you add the following line

in your vimrc, you can toggle zz mode by pressing <Leader>zz.


" maintain a constant zz state, second call will toggle it back off

map <Leader>zz :let &scrolloff=999-&scrolloff<CR>

Comments

try :help scrolloff

with this you can always have some context when scrolling through files.

feline , July 12, 2002 2:46


Advertisement