常忘的vim命令

gu //小写
gU //大写
control a // add one
control x // delete one
gc // 注释
:! //输入命令
t 和 copy 和 co // 复制 //用法:2,3 copy 2
m // move // 用法: 2,3 m 4
gv // 选中上次选中的块
:pwd // print working directory

//打开文件相关
vim *.txt
:ls //listing of all the buffered file
:bnext :bprev // move buffer next and move buffer previous
control + ^ // toggle between buffered files
:butter + number[N] // go to buffered file number N
:bdelete + nubmer[N] // delete
vim *.txt

// 打开文件
vim //不加任何参数
:args .
:args **/.js // **能进入下级目录
:args **/
.js **/*.css

//打开文件相关
:edit //open files relative to the working directory
:edit %// 得到active file 的目录包括文件名字
:edit %:h //得到active file 的目录不包括文件名字

//窗口相关
control-w + s //horizontally
control-w + v // vertically
:only // keep the active window only
:close // close the active window
control-w + = //所有窗口的大小变原始大小
control-w + _ // active window height 变最大
control-w + | // width变最大
[N] + control-w + | //设置宽度为多少column

//通过把app/这个目录下的所有文件加入查找列表, 之后可以通过find 查找文件
:set path+=app/** //** 是要个wildcard
:find Main.js //set 之后就可以find了

//explorer 相关
vim .
:e // open file explorer for current working directory
:E //open file explorer for the directoruy of the active buffer
<c-^> //可以跳回之前的文件或者目录

//颜色主题相关
:colorscheme XXX

//自动补全
control N //跳到下一个补全选项
control p //跳到上一个补全选项
control E // 取消补全窗口

//删除
di" 删除""内的内容
di) 删除()里面的内容

posted @ 2021-11-29 12:26  哇哩顾得  阅读(44)  评论(0编辑  收藏  举报