i a oInsert before cursor, after cursor, on a new line below.
Vim works as verb + count + motion: d2w deletes two words, ci" changes inside quotes. Learn the pieces and they combine.
28 entries
i a oInsert before cursor, after cursor, on a new line below.
EscBack to normal mode.
:w :q :wq :q!Save, quit, save and quit, quit without saving.
u Ctrl-rUndo, redo.
h j k lLeft, down, up, right.
w b eNext word, back a word, end of word.
0 ^ $Line start, first non-blank, line end.
gg G 42GFirst line, last line, line 42.
%Jump to matching bracket.
f x t x ;To / till character x on the line; repeat.
x dd DDelete char, line, to end of line.
yy p PYank (copy) line, paste after, paste before.
cw cc CChange word, line, to end of line.
>> << =Indent, outdent, auto-indent.
.Repeat the last change.
JJoin the line below.
ciw diwChange / delete inner word.
ci" da(Change inside quotes; delete around parentheses.
cit vipChange inside an HTML tag; select paragraph.
/pattern n NSearch forward; next; previous.
* #Search word under cursor forward / back.
:%s/old/new/gReplace everywhere in the file.
:%s/old/new/gcReplace with confirmation.
v V Ctrl-vCharacter, line, block selection.
Ctrl-v jj I// EscBlock insert: comment several lines.
:e file :ls :b2Open file, list buffers, switch buffer.
:sp :vs Ctrl-w wHorizontal / vertical split, cycle windows.
qa … q @a @@Record macro in register a, play it, repeat.
Press Esc, then type :q and Enter. Use :wq to save first or :q! to discard changes.
Both put text in a register, so you can paste either with p. Yank leaves the text in place; delete removes it.
Use :%s/old/new/g. Add c at the end to confirm each replacement.