Learn something new every day §
Ok, fine, I knew some of these already, but I’m no Vim Wizard. Thanks to Coderwall. If you’re interested, my vim configuration is available.
Undo, redo §
u
: undoU
: undo entire lineCtrl + R
: redo
Move the cursor §
b
: move backward one wordw
: move forward one word(
: move backward one “sentence”)
: move forward one “sentence”{
: move backward one “paragraph”}
: move forward one “paragraph”^
: move to beginning of line$
: move to end of linefX
: move to the next occurrence of X on this lineFX
: move to the previous occurrence of X on this linegg
: move to beginning of fileG
: move to end of file
Note that a sentence is a sentence-ending punctuation followed by two spaces, at least according to StackOverflow and a paragraph is a block of text separated by blank lines.
Add to the file §
a
: append after the cursorA
: append at the end of the linei
: insert before the cursorI
: insert at the beginning of the lineo
: insert below the current lineO
: insert above the current line
Change the file §
ce
: replace from cursor to the end of the wordcw
: replace the entire wordc^
: replace from cursor to the beginning of the linec$
: replace from cursor to the end of the lineC
: replace from cursor to the end of the linedd
: delete the entire linedXd
: delete X entire linesd^
: delete from cursor to the beginning of the lined$
: delete from cursor to the end of the linede
: delete from cursor to the end of the worddw
: delete the entire worddaw
: delete the entire word and its surrounding (trailing) whitespacedXw
: delete X entire words
Change the environment §
I probably have to look these up more often than I should.
zg
: add word (correct) to the spellfilezG
: add word (correct) to the internal word listzw
: add word (incorrect) to the spellfilezW
: add word (incorrect) to the internal word list