This document provides a summary of 76 shortcuts for the Vim text editor in Linux. It groups the shortcuts into categories such as cursor movement, visual commands, cutting and pasting, editing, search/replace, working with multiple files, and making text selections in visual mode. Some examples of shortcuts included are h to move left, j to move down, w to jump by word, y to yank (copy) text, :wq to write and quit, /pattern to search for a pattern, and v to start visual mode.
This document provides a summary of 76 shortcuts for the Vim text editor in Linux. It groups the shortcuts into categories such as cursor movement, visual commands, cutting and pasting, editing, search/replace, working with multiple files, and making text selections in visual mode. Some examples of shortcuts included are h to move left, j to move down, w to jump by word, y to yank (copy) text, :wq to write and quit, /pattern to search for a pattern, and v to start visual mode.
h Move left > Shift right j Move down <sc><</sc> Shift left k Move up y yank (copy)marked text l Move right d Delete marked text w Jump by start of words ~ Switch case W Jump by words e Jump to end of words Cut and Paste
E Jump to end of words (no punctuation) yy Yank (copy) a line
b Jump backward by words (punctuation considered 2yy Yank 2 lines
words) yw Yank word B Jump backward by words (no punctuation) y$ Yank to end of line 0 Start of line p Put (paste) the clipboard after cursor ^ First non-blank character of line P Put (paste) before cursor $ End of line dd Delete (cut) a line G Go To command (prefix with number) dw Delete (cut) the current word i Start insert mode at cursor x Delete (cut) current character I Insert at the beginning of the line a Append after the cursor Exiting A Append at the end of the line :w Write (save) the file, but don't exit o Open (append) blank line below current line (no :wq Write (save) and quit need to press return) :q Quit (fails if anything has changed) O Open blank line above current line :q! Quit and throw away changes ea Append at end word Esc Exit insert mode Search/Replace /pattern Search for pattern Editing ?patten Search backward for pattern r Replace a single character (does not use insert mode) n Repeat search in same direction J Join line below to the current one N Repeat search in opposite direction cc Change (replace) an entire line :%s/old/new/g Replace all old with new throughout file cw Change (replace) to the end of word :%s/old/new/gc Replace all old with new throughout file with c$ Change (replace) to the end of line confirmations s Delete character at cursor and subsitute text Working with multiple files S Delete line at cursor and substitute text (same as cc) xp Transpose two letters (delete and paste, technically) :e filename Edit a file in a new buffer
u Undo :bnext Go to next buffer
. Repeat last command :bprev Go to previous buffer
:bd Delete a buffer (close a file) Making text (Visual mode) :sp filename Open a file in a new buffer and split window v Start visual mode, mark lines, then do command Ctrl+ws Split windows (such as y-yank) Ctrl+ww Switch between windows V Start Linewise visual mode Ctrl+wq Quit a window o Move to other end of marked area Ctrl+wv Split windows vertically 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