-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvim-commands.txt
80 lines (66 loc) · 3.26 KB
/
vim-commands.txt
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Organized list of vim commands.
omits
- copying/moving text
- setting/using marks
- screen movements
- regex searching
- visual mode
sources:
http://www.fprintf.net/vimCheatSheet.html
http://vimdoc.sourceforge.net/htmldoc/motion.html
# Commands
## unary:
✓ a Enter insert, move cursor by 1. Repeat whatever was typed in that session [count] times.
✓ A Enter insert at end of current line. Repeat whatever was typed in that session [count] times.
✓ i Enter insert. Repeat whatever was typed in that session [count] times.
✓ I Enter insert, cursor on first non-blank in line. Repeat whatever was typed in that session [count] times.
✓ o Begin a new line below the cursor and insert text, repeat [count] times. [newline]
✓ O Begin a new line above the cursor and insert text, repeat [count] times. [up, newline]
✓ x Delete [count] characters under and after the cursor [delete]
X Delete [count] characters before the cursor [right enough times, delete]
D Delete from under cursor until end of line, plus [count] - 1 following lines [delete enough]
R Enter Replace mode. Repeat whatever was typed in that session [count] times. [not sure]
✓ ~ Switch case of the character under the cursor and move the cursor to the right. If a
[count] is given, do that many characters.[switchCase]
u Undo [count] changes
U Undo all latest changes on one line
ctrl-R Redo [count] changes.
. Repeat last change, with count replaced by [count]
s Delete [count] chars starting from cursor and enter Insert mode. [delete]
S Clear [count] lines (inclusive) and enter Insert mode.
## binary:
gI Insert text in column 1 [count] times.
d{_m_} delete text that _m_ moves over
dd Delete [count] lines. Alias for d_
✓ r{c} replace char under cursor with c. No time limit between presses, but ESC cancels
~{_m_} switch case of text _m_ moves over
# motions (_m_):
## Unary
✓ h,j,k,l Move [count] in resp. direction
0 Move to first char of line
^ Move to first non-blank char of line
$ Move to end of line and [count] - 1 lines down
; Repeat latest f, t, F or T [count] times.
, Repeat latest f, t, F or T in opposite direction [count] times.
- [count] lines upward, on the first non-blank character (linewise).
+/<CR> [count] lines downward, on the first non-blank character (linewise).
_ [count] - 1 lines downward, on the first non-blank character (linewise).
G Goto line [count], default last line, on the first non-blank character.
w [count] words forward
W [count] WORDS forward
e Forward to the end of word [count]
E Forward to the end of WORD [count]
b [count] words backward
B [count] WORDS backward
## Binary
f{char} To [count]'th occurrence of {char} to the right. The cursor is placed on {char}
(inclusive).
F{char} To the [count]'th occurrence of {char} to the left. The cursor is placed on {char}
(inclusive).
t{char} Till before [count]'th occurrence of {char} to the right. The cursor is placed on the
character left of {char} (inclusive).
T{char} Till after [count]'th occurrence of {char} to the left. The cursor is placed on the
character right of {char} (inclusive).
gg Goto line [count], default first line, on the first non-blank character.
ge Backward to the end of word [count]
gE Backward to the end of WORD [count]