Show Menu
Cheatography

Vim navigation Cheat Sheet (DRAFT) by

working progres snippet for my rails projects

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

Edit

gS
to split a one-liner into multiple lines
gJ
(with the cursor on the first line of a block) to join a block into a single­­-line statement.

NORMAL Navigation

%
Jump to matching brace/­par­ent­hesis
}
Jump down to next empty line
{
Jump up to next empty line
]]
Jump down to next
module
or
class
definition
[[
Jump up to next
module
or
class
definition
]m
Jump down to next
def
[m
Jump up to next
def
]M
Jump down to next
end
[M
Jump up to next
end
vim
V LINE
inside current method definition
vam
V LINE
around current method definition

surround ragtag

Mapping
Changed to (cursor = ^)
<C-­­S>=
<%= ^ %>
<C-­­S>-
<% ^ %>
<C-­­X>=
foo<%= ^ %>
<C-­­X>-
foo<% ^ %>
<C-­­X>+
<%= foo^ %>
<C-­­X>_
<% foo^ %>
The table above shows what happens if the binding is pressed at the end of a line consisting of "­­fo­o­".