Skip to content

Instantly share code, notes, and snippets.

@suhailvs
Created November 22, 2014 03:12
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 suhailvs/9aad0d8336de784e3464 to your computer and use it in GitHub Desktop.
Save suhailvs/9aad0d8336de784e3464 to your computer and use it in GitHub Desktop.
VIM COMMANDS

Move

  • h - <-- ,j - down, k - up, l - -->.
  • w - next word, e - end, b - beginning,
  • 5w - 5 words, ,5h - 5 left,
  • 0 - move to beginning of the line, , $(end to the line)
  • gg - move to beggining of file, ,G - end, , 8G - move to 8th line,

Find

  • fo - find a character o, , 3fe - 3rd occurence of e,
  • % - jump to matching paranthesis '[{('
  • *,# - find the word under cursor
  • /text - search for keyword "text", n - next occurence, , N - previous occurence,

Insert

  • o - insert a new line below, ,O - insert a new line above cursor, [changes to INSERT MODE]
  • 3i-<esc> - insert 3 hypens ie:---
  • x - delete char under cursor, ,X - delete char left of cursor,
  • r - to replace a char under the cursor, eg replace with e: "re"
  • d - delete command, , dw - delete word on right side of cursor,

Misc

  • . - repeat previous command
  • u - undo, , <ctrl>+R - redo,
  • v - visual mode, mark the start of char
  • yy - copy current line, ,p - paste,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment