Type | Action | Command |
---|---|---|
Editor | Reload window | :e :edit |
Horizontal split | Ctrl w , s :sp :split |
|
Vertical split | Ctrl w , v :vs :vsplit |
|
Switch between windows | Ctrl w , (xor Ctrl w , h , j , k , l ) |
|
Open new tab | :tabe |
|
Go to next tab | gt |
|
Go to previous tab | gT |
|
Tab move left | :-tabm |
|
Tab move right | :+tabm |
|
Open buffer in new tab | :tabe % |
|
See relative path | Ctrl g |
|
See absolute path | 1 , Ctrl g |
|
Reopen closed buffer | :vs# |
|
Go back to previous buffer | :e# Ctrl-^ |
|
Movement | Jump to top | gg |
Jump to bottom | G |
|
Go back to location of last edit | g; |
|
Go forward in edit history | g, |
|
Edit | Re-indent | Visual select, = |
Re-indent document | gg=G |
|
Replace first in current line | :s/original/new |
|
Replace all in current line | :s/original/new/g |
|
Search and replace | :%s/foo/bar/g |
|
Misc | Copy to clipboard | :w !pbcopy |
Paste from clipboard | :r !pbpaste |
|
Suspend Vim | Ctrl z |
|
Resume from suspension (commandline) | fg |
|
Show trailing whitespace | :set list /\s\+$ |
Last active
November 7, 2018 17:10
-
-
Save remarkablemark/255f802db2a8051744a97395f716402f to your computer and use it in GitHub Desktop.
A collection of useful VIM tips and tricks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To list registers:
:reg
To insert from a register:
%[reg]p
(e.g.%1p
)