-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim.txt
68 lines (67 loc) · 2.44 KB
/
vim.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
vscode-vim
concepts
{C} one char
{M} motion: a move from current cursor position to somewhere else
{T} target of operation: motion (not ^O ^I g* scroll), text object, surround
{O} operation: d y c = < > ~ g~ gu gU gr g? gq (<- can repeat like dd grr) ys (zf g@)
{V} within visual mode
motion (no jump)
h l 0 ^ $ g0 g^ g$ gm |
k j gk gj - + _ g_
w W e E b B ge gE _w _e _b (partial word)
f{C} F{C} t{C} T{C} ; ,
g`{C} g'{C}...
motion (jump)
^O ^I go gd g; g, <NOT {T}>
G gg {N}%
H M L
% ( ) { } [[ ]] [] ][ [( ]) [{ ]} [* ]* [# ]# ]m ]M
/{pattern}<CR> ?{pattern}<CR> /<CR> ?<CR> n N * # g* g#
`{C} '{C} (with m{C})
`` '' (to last position, can set with m` m')
`. `[ `] '. '[ '] (to last changed/put text, but in true vim can also to yanked)
`< `> '< '> (to last visual area)
(easy motion)
__/{pattern}<CR> __j __k __w __b __e __ge __l __h
__s{C} __2s{CC} __f{C} __F{C} __t{C} __T{C}
(sneaky)
s{CC} S{CC} (vs{CC}, but dz{CC}, yz{CC}, cz{CC} g~z{CC}, for dsb is surround)
text object
a* i* (* as: w W s p [ ] b ( ) B { } < > t ' " `)
aa ia (args) ii ai aI (indent) ae ie (entire) i_w (partial word)
2a* 2i* (nested) 2I* 2A* (include whitespace) an* In* (next) Al* il* (last)
surround
{V}S{new} ys{T}{new} ds{old} cs{old}{new}.
{old} & {new}: [ ] b ( ) B { } < > t ' " `
insert
a A i I gI gi o O
delete (into "{C})
x {V}x X {V}X d{T} {V}d dd D J {V}J gJ {V}gJ
yank (into "{C})
y{T} {V}y yy Y
put (from "{C})
p P gp gP [p ]p
replace with register (from "{C})
gr{T} {V}gr grr
change (delete into "{C} and insert new)
c{T} {V}c cc C {V}C s {V}s S {V}S (<- shadowed by surround) {V}R
change without going into insert mode
r{C} {V}r{C} gr{C} (shadowed by replace) R gR ~ {V}~ {V}u {V}U g~{T} gu{T} gU{T}
^A ^X <{T} {V}< << >{T} {V}> >> gq{T} ={T} {V}= == gc{T} {V}gc gcc gC{T} {V}gC gCC
:s & (repeat :s)
undo redo & repeat change
u U ^R . q{C}{commands}q @{C} @@ @:
visual mode
v{T} V{T} ^V{T} o O gv (last v) (v is not {O}. can do v{T}{T}{T}{O})
gn gN (n & v. {O}gn == gn{O}. vgn extends visual area to the END of the matched )
scroll
^E ^Y ^B ^F ^U ^D (sometimes cause motion, no jump, not <T>)
zt zz zb z<CR> z. z-
fold
za zo zO zc zC zM zR
tab
gt gT
window
^W +: s v h l j k o q c w ^W = < > - +
insert mode
^O{command} ^R{register} ^P ^N ^H ^W ^U ^T ^D ^E ^Y ^A ^@