VIMTutor
Linux VIMvitutor
- 上下左右jkhl
- exit: :q,:wq,:q!
- edit: a(append), i(inset)
- delete:
dw (aword) dd(cur line) d$(cursor to the end of current line) d2w(delete 2 words) d2e(delete 2 words ending) 0(start of current line)
2dd delete two lines
x (delete one character)
w (move to the start of next word) e(move to the end of next word) - undo: u(undo last time) U(undo in current line) ctrl+R(recover undo)
- p (put)
7.r’x’(use ‘x’ to replace character original) - ce(change from current character to the end of word) c$(change from current character to the end of line)
- CTRL+G (current location) gg(start of the file) G(end of the file) num G(jump to the line of num)
- / (search from up to bottom)
?(search from bottom to up) use n to next match; N to previous match
% (jump to the match bracket.) - 😒/old/new (replace old to new)
😒/old/new/g( replace all old to new in current line)
:num1,num2s/old/new/g (replece all old to new between row num1 and row num2)
:%s/old/new/g (replece all old to new in whole file)
:%s/old/new/gc (replece all old to new in whole file, need confirm)
12 :!command (execute command. eg. :!ls)
13 v (select and highlight)
14 :w filename(write to filename)
15 :r file (merging file content to current cursor)
:r comand output(reads the output of the dir command and puts it below the cursor)
:e file (edit file)
16 o (open a new line below) O (open a new line above)
a (append after cursor) A (append after current line)
i (insert current cursor) I (insert at the beginning of current line)
17 R (replace insert one character and delete one character at same time)
18 v(select text)+y(copy)+p(put == paste)
j$(jump to next line)
19 :set ic(ignore case when search) :set noic(cancel ignore case set)
:set hls is(highlight when search and show all searched)
20 :help (help window; use ctrl+w to jump to another window)
:help command/page
21 :e ~/.vimrc(enable vim feature)
(:help vimrc-intro)
22 :set nocp (set completible) ctrl+d(show list) tab(complete command)