Vim Cheat Sheet
Vim Cheat Sheet
k - move cursor up
5G - go to line 5
Tip Prefix a cursor movement command with a number to repeat it. For example, 4j
moves down 4 lines.
Editing
r - replace a single character
u - undo
Ctrl + r - redo
aw - mark a word
ab - a block with ()
aB - a block with {}
Visual commands
> - shift text right
~ - switch case
Exiting
:w - write (save) the file, but don't exit
:%s/old/new/gc - replace all old with new throughout file with confirmations
http://vim.rtorr.com/ 4/6
10/9/2014 Vim Cheat Sheet - English
:vsp filename - open a file in a new buffer and vertically split window
Tabs
:tabnew filename or :tabn filename - open a file in a new tab
Ctrl + wt - move the current split window into its own tab
:tabclose or :tabc - close the current tab and all its windows
:tabonly or :tabo - close all tabs except for the current one
Additional Resources
http://vim.rtorr.com/ 5/6
10/9/2014 Vim Cheat Sheet - English
Languages
日本語
Français
English
You can read (and help improve) about how to contribute by viewing our README. There you can see
how to set up this project or how to contribute a new language. Here is a big thank you to our
contributors!
http://vim.rtorr.com/ 6/6