Skip to content

Instantly share code, notes, and snippets.

@rands0n
Last active October 5, 2016 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rands0n/b05fccf94cd0f16c12d6beb10b91bdd1 to your computer and use it in GitHub Desktop.
Save rands0n/b05fccf94cd0f16c12d6beb10b91bdd1 to your computer and use it in GitHub Desktop.

i → Insert mode. Type ESC to return to Normal mode.

x → Delete the char under the cursor

:wq → Save and Quit (:w save, :q quit)

dd → Delete (and copy) the current line

p → Paste

hjkl (highly recommended but not mandatory) → basic cursor move (←↓↑→).

Hint: j looks like a down arrow. :help <command> → Show help about <command>. You can use :help without a <command> to get general help.

Insert mode

a → insert after the cursor

o → insert a new line after the current one

O → insert a new line before the current one

cw → replace from the cursor to the end of the word

Basic moves

0 → go to the first column

^ → go to the first non-blank character of the line

$ → go to the end of line

g_ → go to the last non-blank character of line

/pattern → search for pattern

Copy/Paste

You need to select first what you need to copy. Make this by pressing v.

P → paste before, remember p is paste after current position.

yy → copy the current line, easier but equivalent to ddP

Undo/Redo

u → undo

<C-r> → redo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment