🎉 New! Try the Weekly Task Tracker.

Vijay Pagare

Vim Bindings – Cheatsheet & Notes

Personal vim cheat sheet

impt: command + count + motion

Motions

– h,j,k,l

– w: word start (…W)
– e: word end (…E)
– b: backwards word (…B)
– ge: end of previous word

– gg: page top
– G: page bottom

– 0: beginning of the line index
– $: end of the line (trick: use “A” for the end of line + insert mode.)
– _: beginning of the line content (trick: use “I” for the beginning of line + insert mode.)

– {: move a block of lines up
– }: move to a block of lines down
– %: goto other pair of the parenthesis

– *: occurrence of the word

Commands

  • y: yank

  • d: delete (…D)

  • p: paste

  • x: delete letter (…X)

  • c: change (…C)

  • f: find letter and place cursor on it (…F) + “;” to goto next instance.

  • t: find letter and place cursor before it (…T) + “;” to goto next instance.

  • r: replace letter

  • yy: copy line

  • dd: delete line

  • u: undo

  • Ctrl + r: redo

  • i: insert mode - before cursor

  • a: insert mode - after cursor (append)

  • o: new line below & insert mode

  • O: new line above & insert mode

  • I: insert at the beginning of the line

  • A: append at the end of the line

  • v: visual mode

  • V: visual line mode

  • z: bring the line view to center

  • ~: to toggle between upper and lower case

  • .: to execute last command

  • >>: indent right

  • <<: indent left

Esc - exit mode or reset the command
: - command mode
:39: jump to line number 39
:w - write file
:q - quit file
:q! - quit without saving
:wq - write and quit

macros: combination of commands you wanna store in a letter for later execution (just like “.” but on steroids)

  • q

Tips:

PS:

#Productivity