Skip to content

Instantly share code, notes, and snippets.

@gavinr
Last active February 13, 2018 03:50
Show Gist options
  • Save gavinr/0c683c55fd5c8c3eb0232547f92191ea to your computer and use it in GitHub Desktop.
Save gavinr/0c683c55fd5c8c3eb0232547f92191ea to your computer and use it in GitHub Desktop.
VIM notes

Reminders

  • daw = delete the word under the cursor ("delete a word")

  • caw = delete the word under the cursor and put you in insert mode ("change a word")

  • f<character> = put the cursor on the next character ("find")

  • ^ = go to beginning of text on line (compare to 0)

  • <SHIFT>i = go to beginning of test on line and insert mode.

  • * = search for word in whole doc

  • di" = delete inside quotes

  • yi" = yank inside quotes

  • d stands for delete in Vim, which in other editors is usually called cut

  • y stands for yank in Vim, which in other editors is usually called copy

  • yyp - duplicate line

  • :s/foo/bar/g find/replace in line

  • <ESC> o - To open a line below

  • <ESc> Shift + o - To open a line above.

Copy then replace a word

  • yiw (yank inner word)
  • vwip (visual word insert paste)

Links

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