Skip to content

Instantly share code, notes, and snippets.

@mroffice
Last active February 17, 2016 15:43
Show Gist options
  • Save mroffice/7fa2c4d8302ccc8a82a1 to your computer and use it in GitHub Desktop.
Save mroffice/7fa2c4d8302ccc8a82a1 to your computer and use it in GitHub Desktop.
VIM

Modes

i // => Changes between input mode and normal mode

v // => Changes between visual mode and normal mode

Movement within File

gg // => Takes you to the begginning of the file

G // => Takes you to the end of the file

[n]G // => Takes you to line number n

Movement within Line

0 // => Move to start of line

$ // => Move to end of line

w // => Move to start of next word

e // => Move to end of word

b // => Move to start of last word

Movement within Word

h // => Move cursor left by 1

j // => Move cursor down by 1

k // => Move cursor up by 1

l // => Move cursor right by 1

## Text

o // => Insert a new line below (auto switches to input mode)

O // => Insert a new line above (auto switches to input mode)

x // => Delete the current letter (similar to Delete key on keyboard)

X // => Delete the letter to the left of the cursor (similar to Backspace key on keyboard)

d // => Delete

dw // => Delete the last word

Search

* // => Find next occurrence of current word

# // => Find previous occurrence of current word

/ // => Open search box, use n and N to find previous and next occurrences

r // => Replace current letter

Misc

. // => Repeat the last command

% // => Find matching parenthesis

:set number // => Show line numbers

Highlighting Text

v // => start highlighting text

V // => highlight whole line

d // => cut highlighted text

Y // => copy highlighted text

p // => paste highlighted text before cursor

P // => paste highlighted text after cursor

## Operations

u // => Undo

CTRL + R // => Redo

:w // => Save

:wq // => Save and quit

:q // => Quit

:q! // => Quit without saving

:help // => :)

Analytics

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