Ruby/Rails/Tools
|
:Emodel foo |
|
:EController foo |
|
:Smodel foo |
Open controller foo
in vsplit |
:Vcontroller foo |
Open alternate file |
:A |
Open related file |
:R |
Open Rails console |
:Rails console |
Run current spec file |
,t |
Run nearest spec |
,s |
Run last spec |
,l |
Git blame |
:Gblame |
File Navigation
NERDTree |
F5 |
Open |
o |
Open in vsplit |
s |
Open in hsplit |
i |
Find file in tree |
,v |
Toggle hidden files |
I |
Modify node |
m |
Find fuzzy file |
,cp |
ctrlp Open in vsplit |
Ctrl+V |
ctrlp Open in hsplit |
CTRL+X |
Search string |
:Ack! s |
Open |
o |
Open in vsplit |
v |
Open in hsplit |
h |
Edit previous buffer |
,z |
Edit next buffer |
,x |
Swap between last edited buffers |
,, |
|
|
Text manipulation
Interpolate Ruby String |
,# |
Surround with " |
," |
Surround wuth ' |
,' |
Surround with () |
,( |
Surround with [] |
,[ |
Surround with {} |
,{ |
Change inside "" |
ci" |
Change inside () |
ci( |
Change inside {} |
ci{ |
Change inside [] |
ci[ |
Replace line from cursor |
C |
Insert at end of line |
A |
Insert at beginning of line |
I |
Insert line below cursor |
o |
Insert line above cursor |
O |
Join line with below |
J |
Change delimiter quotes from " to ' |
cs"' |
Delete delimiter quotes |
ds" |
Comment out a line |
gcc |
Comment a selection |
gc |
Motion
Yank inside delimiter (e.g. {}) |
yi{ |
Yank around delimiter (e.g. {}) |
ya{ |
Mark position as 'a' |
ma |
Yank to mark 'a' |
y'a |
Yank inner method |
yim |
Yank around method |
yam |
|
|
Code navigation
Go to method definition |
,f |
Go to method definition in a vsplit |
,F |
Go to matching brace |
% |
Auto Complete |
Ctrl+N |
First character of line |
0 |
End of line |
$ |
Word Forward |
w |
Word Backward |
b |
Page forward |
Ctrl+f |
Page backwards |
Ctrl+b |
Next/Previous method |
]m / [m |
End of method definition |
]M / [M |
Next/Previous class/module |
]] / [[ |
Search and replace
Search forward |
/<pattern> |
Search backwards |
?<pattern> |
Jump to next match |
n |
Jump to previous match |
N |
Replace old
with new
in range
|
:<range>s/<old>/<new>/[g,i,I,c] |
Search forward for word under cursor |
* |
Search backward for word under cursor |
# |
Grep word under cursor |
K |
Remove search highlight |
// |
Misc
New vsplit |
vv |
New hsplit |
ss |
Move to split |
Ctrl+W,l/r/u/d |
Undo |
u |
Redo |
Ctrl+r |
Repeat |
. |
List buffers |
:ls |
|