vim 常用命令

发布时间 2023-07-06 21:53:01作者: evenbao

vim 进入vim
i : command -> edit
esc: edit -> command
:wq a.cpp 保存 -> 退出 (文件名: a.cpp)
:syntax on: 高亮
:set number 显示行号
:q! 不保存 -> 退出
vim ~/.vimrc
命令模式下:
w 跳过下一个单词
h 左 j 上 k 下 l 右
b 往回跳一个单词
ctrl+f 往下翻页
ctrl+b 往上翻页
x+gg 跳到第x行
x + h/j/k/l 往上/下/左/右跳x
esc 撤销
/word 查word n跳下一个 shift+n 上一个
cc 删除当前行 u 恢复
cxc 连续删除x行