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)
評論
目前還沒有任何評論
登錄後才可評論.