Show Menu
Cheatography

vim-personal Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Navigation

,z
previous buffer
,x
next buffer
⌘-j
move up one function
⌘-k
move down one function
Ctrl-o
old cursor position
Ctrl-i
new cursor position

Search­/Code Navigation

,f
find definition of class
,F
find definition of class in V split
,gf/Ctrl-f
go to file in V split
gF
go to file at line number
K
search for word under cursor
,K
grep for word up to next !
⌘-*
highlight current word occurences
,hl
toggle highlight
,gg/,ag
grep command line
Ctrl-x­/Ctrl-z
navigate through search results
,gd
grep for def
,gcf
grep current file to find references to current file
//
clear search

Common editing commands

Ctrl-Space
auto complete
,#
surround with interp­olation
," ,' ,] ,)
surround with quotes or other delimiters
⌘-" ⌘-' ⌘-] ⌘-)
change content inside surrou­nding marks
,.
go to last edit location
,ci
change inside any delimiter
 

File Navigation

,t
CtrlP file selector
,b
CtrlP buffer selector
Ctrl-d
CtrlP file/path mode toggle
⌘-Shift-M
jump to method in current buffer
,jm
jump to models
,jc
jump to contro­llers
,jh
jump to helpers
⌘-Shift-N
NERDTree
Ctrl-\
Show current file in NERDTree
⌘-Shift-P
clearCtrlP cache

Tabs/W­ind­ows­/Splits

⌘-1 to ⌘-9
switch to tabs 1 to 9
Ctrl-h­,l,j,k
move left right down up between splits
vv
vertical split
ss
horizontal split
,qo
open quick fix window
,qc
close quickfix window
 

Utility

Ctrl-p
after pasting, Ctrl-p will cycle through yankring
,yr
view yankring
crs
coerce to snake case
crc
coerce to camel case
cru
coerce to uppercase
,ig
visual indent­ation guide
,cf
copy current full filename to system
,cn
copy current filename to system
,yw
yank a word from anywhere in it
,ow
overwrite word with yank buffer
,w
strip trailing whites­paces
sj
split a line into multiline
sk
unsplit a line
⌘-Shift-A
align things
:Gitv
git log browsers
:Wrap
wrap long lines
⌘-/
toggle comments
gcp
comment paragraph

Rails and Ruby

,vv and ,cc
switch between view and controller
,rs
run spec in iTerm
,rl
run spec line in iTerm
,ss
run spring spec in Iterm
,sl
run spring spec line in iTerm
Ctrl-s
open related spec in split
:Bopen [gem name]
navigate to a gem
,gcp
grep current partial
,orb
outer ruby block