Shortcuts Vim for Linux

We present to your attention the shortcuts for the Vim for Linux which is used on the operating system Linux, in this hotkeys description 76 of the most popular and important shortcuts are offered. You can also add your changes on our portal if you consider the data insufficiently complete or add a new program from the very beginning.

Cursor Movement

Linux Description Edit Cancel Save & submit
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

Editing

Linux Description Edit Cancel Save & submit
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

Making text (Visual mode)

Linux Description Edit Cancel Save & submit
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

Visual commands

Linux Description Edit Cancel Save & submit
> Shift right
< Shift left
y yank (copy)marked text
d Delete marked text
~ Switch case

Cut and Paste

Linux Description Edit Cancel Save & submit
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

Exiting

Linux Description Edit Cancel Save & submit
: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

Search/Replace

Linux Description Edit Cancel Save & submit
/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

Working with multiple files

Linux Description Edit Cancel Save & submit
: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
~~~ The end. Thank you for watching. Add page to bookmarks CTRL + D ~~~
Date of change: 24.01.2019
Page views: 4460
*Some of the keys listed may not work in older versions of the program