-
Notifications
You must be signed in to change notification settings - Fork 0
/
vim_study.txt
45 lines (44 loc) · 1.28 KB
/
vim_study.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
# this is a file for memorizing all the vim commands that I know
w - jump to the beginning of the word
e - jump to the end of the word
I - Insert at the begging of the line
A - Insert at the end of the line
i - normal mode
o - Insert in line under
O - Insert in line above
:%s/regex1/regex2/g - replace all occurences of regex with other regex
:s/regex1/regex2/g - replace one occurence of regex with other regex
cw - change word
dd - delete line
cc - change line
u - undo
CTRL + R - redo
/regex - performs a search
ciw - change inner word
diw - delete inner word
ci( - change inner parenthesis
% - jump between brackets
c% - change lines between parenthesis
:19 - jump to line 19
$ - jump to the end of the line
0 - jump to the beginning of the line
y - yank (copy), in visual mode
SHIFT + v - visual line
CTRL +v - visual block
ZZ - save and exit
zz - center the screen to the current line
> < - shift
= - indent
gg=G - indent the whole file
n - next occurence
N - previous occurence
:set relativenumber - activate relative numbers
:set autoindent - activate auto indentation
r - change current character
:tabstop=4 - how many space a tab should be
:set expandtab - future tabs are converted to spaces
: set noexpandtab -
:retab - convert tabs to spaces
:retab! - convert spaces to tabs
:set list
:set nolist