-
Notifications
You must be signed in to change notification settings - Fork 21
/
vim.sh
60 lines (52 loc) · 1.4 KB
/
vim.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Vim Cheat Sheet
#https://devhints.io/vim
#########
#Exiting
########
:qa #Close all files
:qa! #Close all files, abandon changes
:w #Save
:wq | :w #Save and close file
:q #Close file
:q! #Close file, abandon changes
ZZ #Save and quit
ZQ #Quit without checking changes
#########
#Navigating
########
h j k l #Arrow keys
<C-U> / <C-D> #Half-page up/down
<C-B> / <C-F> #Page up/down
0 (zero) #Start of line
^ #Start of line (after whitespace)
$ #End of line
#########
#Editing
########
a #Append
A #Append from end of line
i #Insert
o #Next line
O #Previous line
s #Delete char and insert
S #Delete line and insert
C #Delete until end of line and insert
r #Replace one character
R #Enter Replace mode
u #Undo changes
<C-R> #Redo changes
#########
#Exiting insert mode
########
Esc / <C-[> #Exit insert mode
<C-C> #Exit insert mode, and abort current command
#########
#Clipboard
########
x #Delete character
dd #Delete line (Cut)
yy #Yank line (Copy)
p #Paste
P #Paste before
"*p / "+p #Paste from system clipboard
"*y / "+y #Paste to system clipboard