vim
2021-06-04 16:42:22 5 举报
AI智能生成
vim 常用命令
作者其他创作
大纲/内容
register
"[reg_char] y/d/x → "[reg_char]p
show: :reg [reg_char]
register
""
unnamed
"0
for y
"+
clipboard
"%
filename
:set clipboard=unnamed
Multi-File Tab
Buff
:e [file]
:e!
:ls
:b [buff_name]/[buff_num]
Window
<c +w>s/v OR :sp :vs
<c +w> / <c +w>hjkl / p(prev)
<c +w>HJKL
[num]<c +w> _ / |
<c +w> +/-/=
:res/vert [num]
Never used
V - Mod
v
V(line) / <c +v>
edit than [ESC] to apply ALL
<> =
u/U
up/lowcase
Macro
q[reg_char] q(quit)
@[reg_char]
@@
1. 如果录制了换行 则 [num]@[reg_char]
2. 没有录制换行 则 V G → :'<,'> normal @[reg_char]
如果只是在首尾操作,进入<c + v>/V模式操作就可以了
:normal [Edit CMD chain]
Auto Completion
<c +n/p> (next/prev)
<c +x> + <c +f> filename
<c +x> + <c +o> need plugins
Move
h j k l
Head: 0^ Tail: $ g_
% --> {}()[]
(){} --> block
[num]G gg(1G) G
gi
w e b / W E B
H M L
zz
<c + u/f> (page Up/Down)
<c + o>
Seach
# * prev/next identifier
[num] f/F t/T [char] than ;, (prev/next)
{/ or ?}[pattern + n/N
s[ubstitute] :% s/[origin]/[target]/g
:% s/\<world\>//n
Edit
to Insert mod
a i o A I O
Shell CMD <c + {a/e,b/f}>shell下才有用
<c + h/w/u> (rm char/word/line)
replace
r / R
change
c[locCMD] ct[char]
s / S rm char / line then Insert
delete
dd __ d[location CMD] __ dt[char]
x
yank
yy __ y[locCMD] __ [v/V-mod]y
than p[aste]
undo / redo
u / <C + r>
May useful
c/d/v/y in/arround {word,},”,)}
:r! [shell cmd]
:r! echo %:p 当前文件全路径名
:colorscheme <c + d>
0 条评论
下一页