RedCoupe

Vi / Vim Shortcuts

by on Jun.15, 2011, under Web design / development

Im always forgetting the very useful vi shortcuts, so here’s a list of them:

ˆ = Control key

If you see a 10, this can be replaced by any number

OperationKeys
Return to Command mode from Insert, overwrite or append modeEscape
Enter Insert modei
Enter overwRite modeR
Enter append modea
Enter append mode at end of this lineA
Enter Insert mode on a new line after thiso
Enter Insert mode on a new line before thisO
Delete this word and enter Insert mode herecw
Delete this line and enter Insert mode herecc
Delete the next 10 lines and enter Insert mode here10cc
Move cursor left one characterleft arrow or h
Move cursor left e.g. 10 characters10h
Move cursor down one linedown arrow or j
Move cursor down 10 lines10j
Move cursor up one lineup arrow or k
Move cursor right one characterright arrow or l
Save this file and continue:w
Save this file and exit:wq
Abort without saving changes to this file:q!
Quit (no changes made):q
Save as a new file “new-file”:w new-file
Load the file “myfile” into vi:e myfile
Delete the character under the cursorx or Del
Delete the current word (inc. space)dw
Delete the next 10 words10dw
Delete the current linedd
Delete the next 10 lines10dd
Delete rest of this line, right of the cursord$
Yank the current line onto the clipboardyy
Yank the current word onto the clipboardyw
Paste the clipboardp
Undou
Redo^r
Jump to the bottom of the fileG
Jump to e.g. the tenth line of the file10G
Jump to the top of the filegg
Jump one page forward^f
Jump half a page forward^u
Jump one page back^b
Jump half a page back^d
Search for text from cursor/text
Find next occurrence of textn
Find previous occurrence of textN
Start of next wordw
End of next worde
Start of the tenth word forward10w
Start of next sentence)
Start of previous sentence(
Start of line0 (zero)
End of line$
Top of screenH
Bottom of screenL
Middle of screenM

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!