Jump to: Cursor Movement, Editing, Making text (Visual mode), Visual commands, Cut and Paste, Exiting, Search/Replace, Working with multiple files
h | Move left |
j | Move down |
k | Move up |
l | Move right |
w | Jump by start of words |
W | Jump by words |
e | Jump to end of words |
E | Jump to end of words (no punctuation) |
b | Jump backward by words (punctuation considered words) |
B | Jump backward by words (no punctuation) |
0 | Start of line |
^ | First non-blank character of line |
$ | End of line |
G | Go To command (prefix with number) |
i | Start insert mode at cursor |
I | Insert at the beginning of the line |
a | Append after the cursor |
A | Append at the end of the line |
o | Open (append) blank line below current line (no need to press return) |
O | Open blank line above current line |
ea | Append at end word |
Esc | Exit insert mode |
r | Replace a single character (does not use insert mode) |
J | Join line below to the current one |
cc | Change (replace) an entire line |
cw | Change (replace) to the end of word |
c$ | Change (replace) to the end of line |
s | Delete character at cursor and subsitute text |
S | Delete line at cursor and substitute text (same as cc) |
xp | Transpose two letters (delete and paste, technically) |
u | Undo |
. | Repeat last command |
v | Start visual mode, mark lines, then do command (such as y-yank) |
V | Start Linewise visual mode |
o | Move to other end of marked area |
Ctrl+v | Start visual block mode |
O | Move to other corner of block |
aw | Mark a word |
ab | A () block (with braces) |
aB | A {} block (with brackets) |
ib | Inner () block |
iB | Inner {} block |
Esc | Exit visual mode |
> | Shift right |
< | Shift left |
y | yank (copy)marked text |
d | Delete marked text |
~ | Switch case |
yy | Yank (copy) a line |
2yy | Yank 2 lines |
yw | Yank word |
y$ | Yank to end of line |
p | Put (paste) the clipboard after cursor |
P | Put (paste) before cursor |
dd | Delete (cut) a line |
dw | Delete (cut) the current word |
x | Delete (cut) current character |
:w | Write (save) the file, but don't exit |
:wq | Write (save) and quit |
:q | Quit (fails if anything has changed) |
:q! | Quit and throw away changes |
/pattern | Search for pattern |
?patten | Search backward for pattern |
n | Repeat search in same direction |
N | Repeat search in opposite direction |
:%s/old/new/g | Replace all old with new throughout file |
:%s/old/new/gc | Replace all old with new throughout file with confirmations |
:e filename | Edit a file in a new buffer |
:bnext | Go to next buffer |
:bprev | Go to previous buffer |
:bd | Delete a buffer (close a file) |
:sp filename | Open a file in a new buffer and split window |
Ctrl+ws | Split windows |
Ctrl+ww | Switch between windows |
Ctrl+wq | Quit a window |
Ctrl+wv | Split windows vertically |
Created by Chirag on 7/13/2017
Advertising for Consideration:
Ads for Consideration:
Please kindly review and accept Terms of Use and Cookie & Policy Policy
1 Comments for 'Vim ' [post comment in main thread]
Comment #1 by Wesley Steinbrink Nov 20, 2013 at 01:12 pm Reply
Great idea. Been looking for something like this for a while. I will put this on my website search.inallearnest.com
Also for the vi shortcuts (vi is actually combinations of single letter shortcuts in the normal mode)
Your vi shortcuts need to mention normal mode versus insert mode.
Some good links are
http://zzapper.co.uk/vimtips.html
(note the link to more vi books)
and
http://www.derekwyatt.org/vim/vim-tutorial-videos/
and for using as a plugin for emacs (scalpal on top of swiss army knife)
http://www.emacswiki.org/emacs/Evil
Reply #1 Wesley Steinbrink Nov 20, 2013 at 01:52 pm
You do have a mention of normal to insert mode. Didn't catch that. Good job.