🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] 参考:https://harttle.land/2015/07/18/vim-cpp.html 配色插件:https://vimjc.com/vim-color-schemes.html#1-acme-colors ## 安装 vim-plug 使用 vim-plug 管理插件, 快捷安装vim-plug ``` mkdir ~/.vim/autoload/ cd ~/.vim/autoload/ wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim ``` ### vim-plug配置介绍 使用vim-plug安装vim插件的方法与另外一个著名的[vim插件管理器Vundle](https://vimjc.com/vim-plugin-manager.html)非常相似,只需要在vim配置文件`~/.vimrc`增加以`call plug#begin(PLUGIN_DIRECTORY)`开始,并以`plug#end()`结束的配置段即可。 下面是一个典型的vim-plug的配置实例,使用了多种vim-plug相关的配置形式。 ``` call plug#begin('~/.vim/plugged') Plug 'junegunn/vim-easy-align' Plug 'https://github.com/junegunn/vim-github-dashboard.git' Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'tpope/vim-fireplace', { 'for': 'clojure' } Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug '~/my-prototype-plugin' call plug#end() ``` 参数解释: `call plug#begin('~/.vim/plugged')`标识vim-plug配置的开始并显式指定vim插件的存放路径为*~/.vim/plugged*; `Plug 'junegunn/vim-easy-align'`使用缩写形式指定了插件在github的地址 ([https://github.com/junegunn/vim-easy-align](https://vimjc.com/[https://github.com/junegunn/vim-easy-align)); `Plug 'https://github.com/junegunn/vim-github-dashboard.git'`则用完整的URL指定插件在github的位置; `Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'`用 | 将两个vim插件写在同一行配置中; `Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }`使用**按需加载**,表明只有在`NERDTreeToggle`命令被调用时, 对应的插件才会被加载; `Plug 'tpope/vim-fireplace', { 'for': 'clojure' }`使用**按需加载**,表明只有编辑*clojure*类型的文件时该插件才会被打开; `Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }`显式指定使用YCM-Generator插件的*stable*分支; `Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }`指定插件所用git标签,rtp描述了包含vim插件的子目录; `Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }`用**dir**选项单独指定了该插件存放的目录,**do**选项用于 Post-update hook,指定在安装或者更新完插件后所需要执行的额外操作; `Plug '~/my-prototype-plugin'`表示不用github托管的本地vim插件; `call plug#end()`用于标识vim-plug配置的结束。 ### 使用vim-plug安装vim插件 在Vim命令行模式下,使用命令`:PlugInstall`可安装vim配置文件中所有配置的vim插件; ``` $ vim :PlugInstall ``` 指定安装某一个或某几个vim插件。 ``` $ vim :PlugInstall [name ...] ``` 查看vim插件的当前状态: ``` $ vim :PlugStatus ``` 安装或更新对应vim插件: ``` $ vim :PlugUpdate [name ...] ``` 而vim-plug本身的更新则使用命令`:PlugUpgrade`。 ``` $ vim :PlugUpgrade ``` vim-plug的命令列表如下所示。 | 命令 | 功能描述 | | --- | --- | | `PlugInstall [name ...] [#threads]` | 安装插件 | | `PlugUpdate [name ...] [#threads]` | 安装或更新vim插件 | | `PlugClean[!]` | 卸装未使用的目录 (bang version will clean without prompt) | | `PlugUpgrade` | 更新vim-plug自身 | | `PlugStatus` | 查看vim插件的状态 | | `PlugDiff` | 对比上次PlugUpdate的更改 (Examine changes from the previous update and the pending changes) | | `PlugSnapshot[!] [output path]` | 保存当前插件的镜像副本到指定目录 (Generate script for restoring the current snapshot of the plugins) | ## 安装C++IDE所需的vim插件 ### 符号索引Universal CTags 使用符号索引插件 ctags 以及 tags 异步生成工具[vim-gutentags](https://github.com/ludovicchabant/vim-gutentags): ``` Plug 'universal-ctags/ctags' Plug 'ludovicchabant/vim-gutentags' " gutentags 搜索工程目录的标志,碰到这些文件/目录名就停止向上一级目录递归 let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project'] " 所生成的数据文件的名称 let g:gutentags_ctags_tagfile = '.tags' " 将自动生成的 tags 文件全部放入 ~/.cache/tags 目录中,避免污染工程目录 let s:vim_tags = expand('~/.cache/tags') let g:gutentags_cache_dir = s:vim_tags " 配置 ctags 的参数 let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q'] let g:gutentags_ctags_extra_args += ['--c++-kinds=+px'] let g:gutentags_ctags_extra_args += ['--c-kinds=+px'] " 检测 ~/.cache/tags 不存在就新建 if !isdirectory(s:vim_tags) silent! call mkdir(s:vim_tags, 'p') endif if !executable('ctags') let g:gutentags_dont_load = 1 endif ``` 如果一个文件没有托管在 .git/.svn 中,gutentags 找不到工程目录的话,就不会为该野文件生成 tags,这也很合理。想要避免的话,你可以在你的野文件目录中放一个名字为 .root 的空白文件,主动告诉 gutentags 这里就是工程目录。 ### 编译运行AsyncRun ``` Plug 'skywind3000/asyncrun.vim' " asyncrun 搜索工程目录的标志,碰到这些文件/目录名就停止向上一级目录递归。 " 如果递归到根目录还没找到,那么文件所在目录就被当作项目目录。 let g:asyncrun_rootmarks = ['.svn', '.git', '.root', '_darcs', 'build.xml'] " 自动打开 quickfix window ,高度为 6 let g:asyncrun_open = 6 " 任务结束时候响铃提醒 let g:asyncrun_bell = 1 " 设置 F10 打开/关闭 Quickfix 窗口 nnoremap <F10> :call asyncrun#quickfix_toggle(6)<cr> " 设置 F7 从工程根目录编译整个工程 nnoremap <silent> <F7> :AsyncRun -cwd=<root> make <cr> ``` ### 代码检查ALE ALE(Asynchronous Lint Engine)支持多种语言的各种代码分析器,如 gcc、cppcheck 等,但需要另行安装并放入 PATH。ALE 能在你修改了文本后自动调用这些 linter 来分析最新代码,然后将各种 linter 的结果进行汇总并显示再界面上。 ``` Plug 'w0rp/ale' let g:ale_linters_explicit = 1 let g:ale_linters = { \ 'csh': ['shell'], \ 'zsh': ['shell'], \ 'go': ['gofmt', 'golint'], \ 'python': ['flake8', 'mypy', 'pylint'], \ 'c': ['gcc', 'cppcheck'], \ 'cpp': ['gcc', 'cppcheck'], \ 'text': [], \} let g:ale_completion_delay = 500 let g:ale_echo_delay = 20 let g:ale_lint_delay = 500 let g:ale_echo_msg_format = '[%linter%] %code: %%s' let g:ale_lint_on_text_changed = 'normal' let g:ale_lint_on_insert_leave = 1 let g:airline#extensions#ale#enabled = 1 let g:ale_c_gcc_options = '-Wall -O2 -std=c99' let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++11' let g:ale_c_cppcheck_options = '' let g:ale_cpp_cppcheck_options = '' ``` ### 修改比较vim-signify ``` Plug 'mhinz/vim-signify' let g:signify_vcs_list = [ 'git' ] let g:signify_sign_show_text = 1 ``` ### 语法高亮vim-cpp-enhanced-highlight ``` Plug 'octol/vim-cpp-enhanced-highlight' let c_no_curly_error = 1 let g:cpp_class_scope_highlight = 1 let g:cpp_member_variable_highlight = 1 let g:cpp_class_decl_highlight = 1 let g:cpp_posix_standard = 1 let g:cpp_experimental_simple_template_highlight = 1 let g:cpp_experimental_template_highlight = 1 let g:cpp_concepts_highlight = 1 let g:cpp_no_function_highlight = 1 ``` ### 编辑辅助vim-unimpaired ``` Plug 'tpope/vim-unimpaired' ``` ### 代码补全YouCompleteMe ``` Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer --go-completer' } let g:ycm_global_ycm_extra_conf='~/.vim/plugged/YouCompleteMe/third_party/ycmd/examples/.ycm_extra_conf.py' let g:ycm_add_preview_to_completeopt = 0 let g:ycm_show_diagnostics_ui = 0 let g:ycm_server_log_level = 'info' let g:ycm_min_num_identifier_candidate_chars = 2 let g:ycm_collect_identifiers_from_comments_and_strings = 1 let g:ycm_complete_in_strings=1 let g:ycm_key_invoke_completion = '<c-z>' " 使用 Ctrl+Z 主动触发语义补全 let g:ycm_seed_identifiers_with_syntax=1 " 语法关键字补全 let g:ycm_confirm_extra_conf=0 " 打开vim时不再询问是否加载ycm_extra_conf.py配置 noremap <c-z> <NOP> set completeopt=menu,menuone " 修改补全列表配色 highlight PMenu ctermfg=0 ctermbg=242 guifg=black guibg=darkgrey highlight PMenuSel ctermfg=242 ctermbg=8 guifg=darkgrey guibg=black " 对指定源文件,输入两个字母后即触发语义补全 let g:ycm_semantic_triggers = { \ 'c,cpp,python,java,go,erlang,perl': ['re!\w{2}'], \ 'cs,lua,javascript': ['re!\w{2}'], \ } let g:ycm_filetype_whitelist = { \ "c":1, \ "cpp":1, \ "go":1, \ "python":1, \ "sh":1, \ "zsh":1, \ } let g:ycm_filetype_blacklist = { \ 'markdown' : 1, \ 'text' : 1, \ 'pandoc' : 1, \ 'infolog' : 1, \} ``` ### 参数提示echodoc 写 C/C++ 时函数忘了可以用上面的 YCM 补全,若是参数忘记了则可以使用 echodoc 插件。当用 YCM 的 tab 补全了一个函数名后,只要输入左括号,下面命令行就会显示出该函数的参数信息,并且随着光标移动高亮出当前参数位置。 ``` Plug 'Shougo/echodoc.vim' set noshowmode ``` ### 函数列表LeaderF 这里定义了 CTRL+P 在当前项目目录打开文件搜索,CTRL+N 打开 MRU 搜索,ALT+P 打开函数搜索,ALT+N 打开 Buffer 搜索,ALT+M 打开 Tag 搜索: ``` Plug 'Yggdroot/LeaderF', { 'do': './install.sh' } let g:Lf_ShortcutF = '<c-p>' let g:Lf_ShortcutB = '<m-n>' noremap <c-n> :LeaderfMru<cr> noremap <m-p> :LeaderfFunction!<cr> noremap <m-n> :LeaderfBuffer<cr> noremap <m-m> :LeaderfTag<cr> let g:Lf_StlSeparator = { 'left': '', 'right': '', 'font': '' } let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git'] let g:Lf_WorkingDirectoryMode = 'Ac' let g:Lf_WindowHeight = 0.30 let g:Lf_CacheDirectory = expand('~/.vim/cache') let g:Lf_ShowRelativePath = 0 let g:Lf_HideHelp = 1 let g:Lf_StlColorscheme = 'powerline' let g:Lf_PreviewResult = {'Function':0, 'BufTag':0} ``` ### 文件浏览vim-dirvish 头文件和源文件之间可以使用`:A`命令快速切换,其它可以折腾下 dirvish。 ``` Plug 'vim-scripts/a.vim' Plug 'justinmk/vim-dirvish' ``` ### 其它 ``` set autoindent " Indent according to previous line. set expandtab " Use spaces instead of tabs. set softtabstop =4 " Tab key indents by 4 spaces. set shiftwidth =4 " >> indents by 4 spaces. set shiftround " >> indents to next multiple of 'shiftwidth'. set hidden " Switch between buffers without having to save first. set display =lastline " Show as much as possible of the last line. set ttyfast " Faster redrawing. set lazyredraw " Only redraw when necessary. set splitbelow " Open new windows below the current window. set splitright " Open new windows right of the current window. set cursorline " Find the current line quickly. set wrapscan " Searches wrap around end-of-file. set report =0 " Always report changed lines. set synmaxcol =120 " Only highlight the first 200 columns. set list " Show non-printable characters. if has('multi_byte') && &encoding ==# 'utf-8' let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' else let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' endif " Put all temporary files under the same directory. let s:vim_backup = expand("$HOME/.vim/files/backup/") if !isdirectory(s:vim_backup) silent! call mkdir(s:vim_backup, 'p') endif let s:vim_swap = expand("$HOME/.vim/files/swap/") if !isdirectory(s:vim_swap) silent! call mkdir(s:vim_swap, 'p') endif let s:vim_undo = expand("$HOME/.vim/files/undo/") if !isdirectory(s:vim_undo) silent! call mkdir(s:vim_undo, 'p') endif let s:vim_info = expand("$HOME/.vim/files/info/") if !isdirectory(s:vim_info) silent! call mkdir(s:vim_info, 'p') endif set backup set backupdir =$HOME/.vim/files/backup/ set backupext =-vimbackup set backupskip = set directory =$HOME/.vim/files/swap/ set updatecount =100 set undofile set undodir =$HOME/.vim/files/undo/ set viminfo ='100,n$HOME/.vim/files/info/viminfo ``` 最后在Vim命令行模式下,使用命令`:PlugInstall`安装vim配置文件中所有配置的vim插件 ``` $ vim :PlugInstall ``` ## 出现过的问题 出现过问题”ouCompleteMe unavailable: No module named ycmd”, 解决办法 ``` cd ~/.vim/plugged/YouCompleteMe git pull git submodule update --init --recursive apt-get install python3-dev cmake ./install.sh --clang-completer ``` 如果是使用其他语言,官网也给出了安装命令,不过也要安装对应的开发语言环境: ``` C++: python3 install.py --clang-completer C#:install Mono and run python3 install.py --clangd-completer Go:install Go and run python3 install.py --go-completer JS and TypeScript:install Node.js and rpm and run python3 install.py --ts-completer Rust:python3 install.py --rust-completer Java:install JDK8 and python3 install.py --java-completer ``` 如果你想一劳永逸,也可以全部安装,不过也需要把每种语言的环境都安装好才可以: ``` python3 install.py --all ``` ## 总结 其实只有三部就可以配置好vim+C++的IDE 1. 安装vim-plug 2. 配置~/.vimrc 3. 执行`:PlugInstall`命令 加载项目树 ``` $ vim :NERDTreeToggle ``` ## 插件集合 只需要把下面的内容复制到 ~/.vimrc里,然后执行`:PlugInstall`命令即可 ``` " 关闭兼容模式 set nocompatible set nu " 设置行号 set cursorline "突出显示当前行 " set cursorcolumn " 突出显示当前列 set showmatch " 显示括号匹配 " tab 缩进 set tabstop=4 " 设置Tab长度为4空格 set shiftwidth=4 " 设置自动缩进长度为4空格 set autoindent " 继承前一行的缩进方式,适用于多行注释 " 定义快捷键的前缀,即<Leader> let mapleader=";" " ==== 系统剪切板复制粘贴 ==== " v 模式下复制内容到系统剪切板 vmap <Leader>c "+yy " n 模式下复制一行到系统剪切板 nmap <Leader>c "+yy " n 模式下粘贴系统剪切板的内容 nmap <Leader>v "+p " 开启实时搜索 set incsearch " 搜索时大小写不敏感 set ignorecase syntax enable syntax on " 开启文件类型侦测 filetype plugin indent on " 启用自动补全 " 退出插入模式指定类型的文件自动保存 au InsertLeave *.go,*.sh,*.php write "============================================================================== " 插件配置 "============================================================================== " 插件开始的位置 call plug#begin('~/.vim/plugged') Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } " 符号索引Universal CTags Plug 'universal-ctags/ctags' Plug 'ludovicchabant/vim-gutentags' " 编译运行AsyncRun Plug 'skywind3000/asyncrun.vim' " 可以在文档中显示 git 信息 Plug 'airblade/vim-gitgutter' " 下面两个插件要配合使用,可以自动生成代码块 Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' " 配色方案 " colorscheme neodark Plug 'KeitaNakamura/neodark.vim' " colorscheme monokai Plug 'crusoexia/vim-monokai' " colorscheme github Plug 'acarapetis/vim-colors-github' " colorscheme gruvbox Plug 'morhetz/gruvbox' " 代码检查 Plug 'w0rp/ale' " 修改比较vim-signify Plug 'mhinz/vim-signify' " 语法高亮vim-cpp-enhanced-highlight Plug 'octol/vim-cpp-enhanced-highlight' " 编辑辅助vim-unimpaired Plug 'tpope/vim-unimpaired' " 代码补全YouCompleteMe Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer --go-completer' } " 参数提示echodoc Plug 'Shougo/echodoc.vim' " 函数列表LeaderF Plug 'Yggdroot/LeaderF', { 'do': './install.sh' } " 文件浏览vim-dirvish Plug 'vim-scripts/a.vim' Plug 'justinmk/vim-dirvish' " markdown 插件 Plug 'iamcco/mathjax-support-for-mkdp' Plug 'iamcco/markdown-preview.vim' call plug#end() "============================================================================== " 主题配色 "============================================================================== " 开启24bit的颜色,开启这个颜色会更漂亮一些 set termguicolors " 配色方案, 可以从上面插件安装中的选择一个使用 set background=dark " 主题背景 dark-深色; light-浅色 colorscheme gruvbox" 主题 "============================================================================== " NERDTree 插件 "============================================================================== " 打开和关闭NERDTree快捷键 map <F10> :NERDTreeToggle<CR> " 显示行号 let NERDTreeShowLineNumbers=1 " 打开文件时是否显示目录 let NERDTreeAutoCenter=1 " 是否显示隐藏文件 let NERDTreeShowHidden=0 " 设置宽度 " let NERDTreeWinSize=31 " 忽略一下文件的显示 let NERDTreeIgnore=['\.pyc','\~$','\.swp'] " 打开 vim 文件及显示书签列表 let NERDTreeShowBookmarks=2 " 在终端启动vim时,共享NERDTree let g:nerdtree_tabs_open_on_console_startup=1 " gutentags 搜索工程目录的标志,碰到这些文件/目录名就停止向上一级目录递归 let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project'] " 所生成的数据文件的名称 let g:gutentags_ctags_tagfile = '.tags' " 将自动生成的 tags 文件全部放入 ~/.cache/tags 目录中,避免污染工程目录 let s:vim_tags = expand('~/.cache/tags') let g:gutentags_cache_dir = s:vim_tags " 配置 ctags 的参数 let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q'] let g:gutentags_ctags_extra_args += ['--c++-kinds=+px'] let g:gutentags_ctags_extra_args += ['--c-kinds=+px'] " 检测 ~/.cache/tags 不存在就新建 if !isdirectory(s:vim_tags) silent! call mkdir(s:vim_tags, 'p') endif if !executable('ctags') let g:gutentags_dont_load = 1 endif " asyncrun 搜索工程目录的标志,碰到这些文件/目录名就停止向上一级目录递归。 " 如果递归到根目录还没找到,那么文件所在目录就被当作项目目录。 let g:asyncrun_rootmarks = ['.svn', '.git', '.root', '_darcs', 'build.xml'] " 自动打开 quickfix window ,高度为 6 let g:asyncrun_open = 6 " 任务结束时候响铃提醒 let g:asyncrun_bell = 1 " 设置 F10 打开/关闭 Quickfix 窗口 nnoremap <F10> :call asyncrun#quickfix_toggle(6)<cr> " 设置 F7 从工程根目录编译整个工程 nnoremap <silent> <F7> :AsyncRun -cwd=<root> make <cr> let g:ale_linters_explicit = 1 let g:ale_linters = { \ 'csh': ['shell'], \ 'zsh': ['shell'], \ 'go': ['gofmt', 'golint'], \ 'python': ['flake8', 'mypy', 'pylint'], \ 'c': ['gcc', 'cppcheck'], \ 'cpp': ['gcc', 'cppcheck'], \ 'text': [], \} let g:ale_completion_delay = 500 let g:ale_echo_delay = 20 let g:ale_lint_delay = 500 let g:ale_echo_msg_format = '[%linter%] %code: %%s' let g:ale_lint_on_text_changed = 'normal' let g:ale_lint_on_insert_leave = 1 let g:airline#extensions#ale#enabled = 1 let g:ale_c_gcc_options = '-Wall -O2 -std=c99' let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++11' let g:ale_c_cppcheck_options = '' let g:ale_cpp_cppcheck_options = '' let g:signify_vcs_list = [ 'git' ] let g:signify_sign_show_text = 1 let c_no_curly_error = 1 let g:cpp_class_scope_highlight = 1 let g:cpp_member_variable_highlight = 1 let g:cpp_class_decl_highlight = 1 let g:cpp_posix_standard = 1 let g:cpp_experimental_simple_template_highlight = 1 let g:cpp_experimental_template_highlight = 1 let g:cpp_concepts_highlight = 1 let g:cpp_no_function_highlight = 1 let g:ycm_global_ycm_extra_conf='~/.vim/plugged/YouCompleteMe/third_party/ycmd/examples/.ycm_extra_conf.py' let g:ycm_add_preview_to_completeopt = 0 let g:ycm_show_diagnostics_ui = 0 let g:ycm_server_log_level = 'info' let g:ycm_min_num_identifier_candidate_chars = 2 let g:ycm_collect_identifiers_from_comments_and_strings = 1 let g:ycm_complete_in_strings=1 let g:ycm_key_invoke_completion = '<c-z>' " 使用 Ctrl+Z 主动触发语义补全 noremap <c-z> <NOP> set completeopt=menu,menuone " 修改补全列表配色 highlight PMenu ctermfg=0 ctermbg=242 guifg=black guibg=darkgrey highlight PMenuSel ctermfg=242 ctermbg=8 guifg=darkgrey guibg=black " 对指定源文件,输入两个字母后即触发语义补全 let g:ycm_semantic_triggers = { \ 'c,cpp,python,java,go,erlang,perl': ['re!\w{2}'], \ 'cs,lua,javascript': ['re!\w{2}'], \ } let g:ycm_filetype_whitelist = { \ "c":1, \ "cpp":1, \ "go":1, \ "python":1, \ "sh":1, \ "zsh":1, \ } let g:ycm_filetype_blacklist = { \ 'markdown' : 1, \ 'text' : 1, \ 'pandoc' : 1, \ 'infolog' : 1, \} set noshowmode let g:Lf_ShortcutF = '<c-p>' let g:Lf_ShortcutB = '<m-n>' noremap <c-n> :LeaderfMru<cr> noremap <m-p> :LeaderfFunction!<cr> noremap <m-n> :LeaderfBuffer<cr> noremap <m-m> :LeaderfTag<cr> let g:Lf_StlSeparator = { 'left': '', 'right': '', 'font': '' } let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git'] let g:Lf_WorkingDirectoryMode = 'Ac' let g:Lf_WindowHeight = 0.30 let g:Lf_CacheDirectory = expand('~/.vim/cache') let g:Lf_ShowRelativePath = 0 let g:Lf_HideHelp = 1 let g:Lf_StlColorscheme = 'powerline' let g:Lf_PreviewResult = {'Function':0, 'BufTag':0} "============================================================================== " 其他插件配置 "============================================================================== " markdwon 的快捷键 map <silent> <F5> <Plug>MarkdownPreview map <silent> <F6> <Plug>StopMarkdownPreview " tab 标签页切换快捷键 :nn <Leader>1 1gt :nn <Leader>2 2gt :nn <Leader>3 3gt :nn <Leader>4 4gt :nn <Leader>5 5gt :nn <Leader>6 6gt :nn <Leader>7 7gt :nn <Leader>8 8gt :nn <Leader>9 8gt :nn <Leader>0 :tablast<CR> ```