Buffers
Key | Command |
:ls | list buffers |
Ctrl+6 | go to alt buffer |
:bp | Go back |
:bn | Go forward |
:bd # | Delete buffer |
:e name | Edit file |
gf ^w,f | Goto file (F) at pos |
|
Key | Command |
Ctrl+w n | New buffer |
Ctrl+w,v | Vert split |
Ctrl+w,s | Horiz split |
Ctrl+w,q | Close |
Ctrl+w,o | Close others |
Ctrl+w,K | Move up |
Ctrl+w,+ > | Reize |
:new | r! grep -nrI pat |
:new | r! git blame ^r% |
|
Folding / Diff
Key | Command |
zM zR | Fold/Unfold all |
za | Fold/Unfold |
zo zc | Open/Close fold |
]c | Next change |
[c | Prev change |
do | Diff get |
dp | Diff put |
$ P4DIFF=vimdiff p4 … |
:windo set wrap |
|
Key | Command |
m[a-z`] | Set mark at pos |
`[a-z`] | Jump to mark |
Ctrl+o | Go back |
Ctrl+i | Go forward |
`. | Last change pos |
g; | Last change pos |
g, | Next change pos |
|
Visual Mode
Key | Command |
v or V | Enter visual mode |
Esc | Exit visual mode |
< or > | Shift text |
y/^r" | find selection |
yq/p | find selection |
^VI#[esc] |
|
CTags
Key | Command |
g,Ctrl+] | Goto or list |
Ctrl+] | Go to tag |
g] | List tags |
Ctrl+t | Jump back |
|
Line Change
Key | Command |
C | Change to eol |
cc | Change the line |
D | Delete to eol |
A or I | Append/Insert |
|
Undo
Key | Command |
u or U | Undo (Line) |
Ctrl+r | Redo |
|
Key | Command |
yiw | yank inner word |
viwp | select, replace |
viw"0p | third time |
Vp | replace line |
|
Autocomplete
Key | Command |
^x,^o | Omni complete |
^x,^] | CTags complete |
^n | prev or nav down |
^p | next or nav up |
^e | cancel |
:pc | preview close |
^wz | preview close |
|
Misc
Key | Command |
:!% | execute filename |
:r!% | read into buffer |
>aB | Indent a Block |
cs find | cscope find |
^r,^w | word at cursor |
:cs find s ^r^w |
|
|