Vim 前端插件整理
技.技术研究56 阅读约 6 分钟
Vim 移动命令
- w/e基于单词移动,gg/G文件首尾,0/$行首位,f{char}查寻字符
- ctrl+f ctrl+u 前后翻屏
Vim 插件管理器
https://github.com/junegunn/vim-plug
修改启动界面
https://github.com/mhinz/vim-startify
状态栏美化
https://github.com/vim-airline/vim-airline
增加代码缩进线条
https://github.com/yggdroot/indentline
vim-bybird 配色
https://github.com/wong/vim-hybird
solarized 配色
gruvbox 配色
https://github.com/morhetz/gruvbox
nerdtree 文件管理器
https://github.com/scrooloose/nerdtree
autocmd vimenter * NERDTree
nerdtree 配置(文件管理器)
默认自动打开
- nnoremap
v :NERDTreeFind
找到当前文件目录树(ctrl+w+p 回到上次编辑的文件) - nnoremap
g :NERDTreeToggle
关闭/打开目录树 - let NERDTreeShowHidden=1
目录树忽略文件 - let NERDTreeIgnore = ['.git$']
m # 显示文件系统菜单(添加、删除、移动等操作)
ctrlp 文件搜索
https://github.com/ctrlpvim/ctrlp.vim
定位与搜索文本
https://github.com/easymotion/vim-easymotion
成对编辑
https://github.com/tpope/vim-surround
$ ys iw " 添加引号
$ cs " ' 双引号替换成单引号
$ ds " 删除双引号
模糊搜索
https://github.com/junegunn/fzf.vim
使用 Ag [PATTERN] 模糊搜索字符串 todo: 目前使用无效
使用 Files [PATH] 模糊搜索目录
搜索替换插件
https://github.com/brooth/far.vim
:Far foo bar **/*.py
:Fardo
浏览代码(代码大纲)
https://github.com/brooth/tagbar
, + t
高亮单词
https://github.com/lfv89/vim-interestingwords
默认
上下移动 n and N
清除
异步补全插件
https://github.com/shougo/deoplete.nvim
https://github.com/deoplete-plugins/
ctrl+x+o
微软 coc 异步补全插件
https://github.com/neoclide/coc.nvim
格式化
https://github.com/sbdchd/neoformat
需要安装对应的 lint 库
:Neoformat
静态检查
https://github.com/dense-analysis/ale
需要安装对应的 lint 库
注释代码
https://github.com/tpope/vim-commentary
gc 注释/与取消注释
todo:配合 V 实现多行注释
在 vim 中使用 git
https://github.com/tpope/vim-fugitive
在 vim 中显示文件的改变
https://github.com/airblade/vim-gitgutter
在 vim 中查看 git 提交记录
https://github.com/junegunn/gv.vim
:GV to open commit browser
You can pass git log options to the command, e.g. :GV -S foobar.
:GV! will only list commits that affected the current file
:GV? fills the location list with the revisions of the current file
vim-devicons 在NerdTree中显示图标
需要使用官方字体:https://www.nerdfonts.com/font-downloads
Plug ‘ryanoasis/vim-devicons’
vim-nerdtree-syntax-highlight 根据文件类型显示不同的图标和颜色
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
相关文章
评论 (0)
还没有评论,来抢沙发
