A list of vim commands I found helpful.
- List all open buffers:
:ls
- List current directory:
:pwd
- Change to other directory:
:cd
- Split buffers horizontally:
:sp <file>
orctrl-w s
with:edit <file>
- Split buffers vertically:
:vsp <file>
orctrl-w v
with:edit <file>
- Close other buffers:
only
- Cycle through all buffers:
ctrl-w w
- Resizing buffers:
- Increase size:
ctrl-w +
- Decrease size:
ctrl-w -
- Equal sizes :
ctrl-w =
- Maximize horizontally:
ctrl-w _
- Maximize vertically:
ctrl-w |
- Increase size:
- Rotating buffers:
- Rotate all buffers clockwise:
ctrl-w r
- Rotate all buffers anti-clockwise:
ctrl-w R
- Swap current windows with its immediate neighbour:
ctrl-w x
- Moving current buffer:
- Move upward:
ctrl-w K
- Move downward:
ctrl-w J
- Move left:
ctrl-w H
- Move right:
ctrl-w L
- Edit file in new tab:
:tabedit <file>
- Move a buffer into its tab:
ctrl-w T
- Close a tab:
:tabclose
- Close all other tabs:
:tabonly
- Rotate through all tabs closewise:
gt
- Rotate through all tabs anticlockwise:
gT
- Navigate directly to N-th tab:
Ngt
where N = 1,2,3,... - Re-ordering tabs
- Move a tab to the end:
:tabmove
- Move a tab to the beginning:
:tabmove 0
- Move a tab to follow after tab 1:
:tabmove 1
- Open command-line windows:
q:
or:ctrl-f
- Open command-line search windows:
q\