Golden Thumb

1-on-1 tutor of chosen kids
个人资料
正文

分享我自己最常用的vim编辑命令。有的小朋友如五年级的 Felix 熟悉得很快

(2021-01-23 11:40:21) 下一个

如果到网上搜,有的结果集太大,有的太小。下面我自己总结的,相对适中。以这个为基础,不够了再添加新的,会越来越接近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"

[ 打印 ]
阅读 ()评论 (0)
评论
目前还没有任何评论
登录后才可评论.