虽然 vi 用了好几年, 但没有真正的驾驭好vi
vi ---- vee-eye
vim, a X-based interface
1 insert mode
2 command mode
i --- insert
cw --- change word
typeseter
stty command : when the terimal is not control , can display and set the reponding key-values.
:pre & fg
h <--
l -->
|
|
j V
k ^
|
|
number as prefix parameters ---- 4L0 (begin of line)
^ (first char in line )
$ (end of line)
G ( go )
G ( go to end of file(buffer) )
gg ( go to first line )
number G : go the number line.
cw, c2b, c$, c0
cc (change line)
(command) (text object)
(number) (command) (text object)
C=c$
s (substitution/replace char)
S (replace whole line )
r (replace a char)
R (replace mode, replace the next char untill ESC key)
~ (upler and lower convert) (new version: number ~ : 6~)
d (delete )
dw (delete word ) d2w,2dw, db, d0,d$
dd (delete line) 2dd
D = d$
x (delete current char of cursor )
X ( delete char before )
p (paste from cut buffer)
xp (swap the 2 char )
dwwP (swap the 2 word)
ddp( swap 2 line )
y yank( copy)
yy=Y, yw, y$, 4yy
. (repeat commond)
u (undo)
U (undo the line )
ctrl+r = (redo command)
A = append at $
I = insert at begin of line
o = line-feed and insert
O = line-feed at last line
S = delete line and insert
J = join
这些都是基本的vi(m) 命令, 总结自己没能掌握的原理是:
1 思维的定势, 如删除几行, 就会用dd一行一行的删,
2 训练有限, 缺少压力
3 没有形成vi的思维
以后的学习, 尽可能的在用vi命令的时候思考一会,形成良好的放射效应。
努力学习linux内核及相关软件的维护与管理, 做一个优秀linux工程师。