Showing posts with label vim. Show all posts
Showing posts with label vim. Show all posts

Monday, April 9, 2012

comment visual block vim

select your lines using visual block: CTRL+v
type I to go to insert mode before the block
type the comment char (e.g. #)
press ESC

Thursday, April 5, 2012

Vim folding commands


In visual mode ty zf to fold the visual area.

zf#j creates a fold from the cursor down # lines.
zf/string creates a fold from the cursor to string .
zj moves the cursor to the next fold.
zk moves the cursor to the previous fold.
zo opens a fold at the cursor.
zO opens all folds at the cursor.
zm increases the foldlevel by one.
zM closes all open folds.
zr decreases the foldlevel by one.
zR decreases the foldlevel to zero -- all folds will be open.
zd deletes the fold at the cursor.
zE deletes all folds.
[z move to start of open fold.
]z move to end of open fold.