List open buffers:
:ls
Open buffer by file name:
:b <buffer-name>
Split (vertically) and open buffer:
:sb <buffer-name>
Split (vertically) and open buffer:
:vsp | b <buffer-name>
To comment a block of lines
- Enter the visual block mode CTRL + V
- Selected the lines to comment/uncomment
- Press SHIFT + I (capital i)
- Press ALT + # (insert a hash #)
- Press ESC and wait
To uncomment a block of lines
- Enter the visual block mode CTRL + V
- Selected the lines to comment/uncomment
- Press x
To comment a block of lines
- Enter the visual mode with v
- Select the lines to comment
- Press SHIFT + :
- Enter norm i# (:'<,'>norm i#) ^ this will insert a # at the first position of every line
To uncomment a block of lines
- Enter the visual mode with v
- Select the lines to comment
- Press SHIFT + :
- Enter norm x (:'<,'>norm x) ^ this will delete the first char of every line