This repository has been archived by the owner on Jun 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Luan's Vim Cheat Sheet
Luan Santos edited this page Oct 18, 2017
·
15 revisions
Command | Action |
---|---|
⏎ |
Save current buffer |
<space> |
Clear highlighted search |
\ |
Toggle NERDTree |
∣ |
Reveal current file in NERDTree |
<F6> |
Toggle PASTE mode (set paste or set nopaste ) |
<F8> |
Toggle TagBar |
,f or ⌃p
|
Fuzzy find file |
,b |
Fuzzy find buffer |
,, |
Go to last file |
:A or ,.
|
Go to alternate file (test file/implementation) |
:AV |
Open alternate file in vertical split |
:AS |
Open alternate file in horizontal split |
:AT |
Open alternate file in a new tab |
yf |
Copy current filepath to clipboard |
⌃] or g<Left-Click>
|
Go to definition (need tags to be generated) |
gd |
Go to definition (does not need tags to be generated) |
⌃w ] |
Open definition in horizontal split (need tags to be generated) |
g] |
List all definitions (need tags to be generated) |
⌃t or :pop
|
Pop tag stack (go up a level) |
:tag |
"Push" tag stack (go down a level) |
,S |
Fuzzy search all tags (slow) |
,F |
Fuzzy search tags in current buffer |
gcc |
(Un)comment current line |
<Visual>gc |
(Un) comment selection |
gc [operator]
|
Operator to (un)comment blocks of text |
,Y |
Copies the current file path to the clipboard |
,C |
Copies the current file path + line number to the clipboard |
,<space> |
Re-run last vipe command (needs vipe to be running)
|
,z |
Move to the buffer on the left |
,x |
Move to the buffer on the right |
:!ctags -R |
Generate ctags for current project |
Command | Action |
---|---|
,gs or Gstatus
|
Open git status window |
,gb or Gblame
|
Open git blame window |
,gpl |
Git pull --rebase |
,gps |
Git push origin head |
,gj |
Next changed hunk in file |
,gk |
Previous changed hunk in file |
Command | Action |
---|---|
⌃n |
Next change |
⌃p |
Previous change |
- |
(Un)stage change |
cc |
Commit - opens git message editor |
ca |
Ammend - opens git message editor with previous commit |
D |
Show :Gdiff of file under cursor |
⏎ |
Open file under cursor |
Command | Action |
---|---|
,t |
Run tests using vipe (needs vipe to be running)
|
,T |
Run focused tests using vipe (needs vipe to be running)
|
Command | Action |
---|---|
,t |
Run tests using vipe (needs vipe to be running)
|
,T |
Run focused tests using vipe (needs vipe to be running)
|