常用VIM插件配置

时间:2022-07-22 23:05:09

airline 状态栏美化

除了airline本体还要下airline主题

和打过powerline补丁的字体

常用设置:

set laststatus=2                                           " 总是显示状态栏
set noshowmode
set t_Co=256 " 显示颜色
"let g:airline_theme="badwolf"
let g:airline_theme="gruvbox"
"let g:airline_theme="one"
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_powerline_fonts = 1 " 使用powerline打过补丁的字体
let g:airline#extensions#tabline#enabled = 1 " 开启tabline
"let g:airline#extensions#tabline#left_sep = ' ' " tabline中当前buffer两端的分隔字符
"let g:airline#extensions#tabline#left_alt_sep = '|' " tabline中未激活buffer两端的分隔字符
"let g:airline#extensions#tabline#buffer_nr_show = 1 " tabline中buffer显示编号
let g:airline#extensions#tabline#formatter = 'unique_tail' " 显示标签的样式为只显示文件名

nerdcommenter 代码注释

常用设置:

let g:NERDSpaceDelims = 1                                             " Add spaces after comment delimiters by default
let g:NERDCompactSexyComs = 1 " Use compact syntax for prettified multi-line comments
let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
" let g:NERDAltDelims_java = 1 " Set a language to use its alternate delimiters by default
" let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } } " Add your own custom formats or override the defaults
let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDTrimTrailingWhitespace = 1 " Enable trimming of trailing whitespace when uncommenting
let g:NERDToggleCheckAllLines = 1 " Enable NERDCommenterToggle to check all selected lines is commented or not

vim-mark 高亮单词

Basic Usage:

m : 高亮鼠标选中的单词

n : 取消高亮鼠标选中的单词,若鼠标没有选中任何单词,则取消所有高亮的单词

vim-signature

Basic Usage:

mx - Toggle mark 'x' and display it in the leftmost column

dmx - Remove mark 'x' where x is a-zA-Z

m - Delete all marks from the current buffer

m/ - Open location list and display marks from current buffer

m[0-9] - Toggle the corresponding marker !@#$%^&*()

m? - Open location list and display markers from current buffer

m - Remove all markers

CtrlP 文件搜索

Basic Usage:

Run :CtrlP or :CtrlP [starting-directory] to invoke CtrlP in find file mode.

Run :CtrlPBuffer or :CtrlPMRU to invoke CtrlP in find buffer or find MRU file mode.

F5 :刷新缓存

文本搜索

EasyGrep

Basic Usage:

vv - Grep for the word under the cursor, match all occurences,

like |gstar|

vV - Grep for the word under the cursor, match whole word, like

|star|

va - Like vv, but add to existing list

vA - Like vV, but add to existing list

vr - Perform a global search on the word under the cursor

and prompt for a pattern with which to replace it.

备用:Ag

先要安装ag