如果到网上搜,有的结果集太大,有的太小。下面我自己总结的,相对适中。以这个为基础,不够了再添加新的,会越来越接近vim熟手。
有什么用?绝大部分的服务器上用得着,vim或vi是最基本的编辑器。
The following are some useful vim commands:
after pressing esc key,
x: delete a char
dd: delete a line
3 dd: delete 3 lines
u: undo
o: open a new line below
O: open a new line above
yy: to copy a line
p: paste below
P: paste above
3yy: copy 3 lines
0: jump to the beginning of current line
$: jump to the end of current line
j: up
k: down
h: left
l: right
fw: find letter "w" in current line
rw: replace current letter with "w"
i: insert
a: append
w: jump to next word
dw: delete a word
d$: delete to end of line
ctrl+r: redo, the opposite of u (undo)
7G: jump to line 7
gg: go to top
G: go to bottom
find "abc":
/abc, followed by enter, followed by n for "next"