1.vim配置文件:【~/.vimrc】没有就新建一个进行配置
2.vim插件管理器:【vimplug】
安装地址:https://github.com/junegunn/vim-plug
下载此项放置到~/.vim/autoload/目录下,没有这个文件夹就新建一个放进去
将下列加入~/vimrc配置文件中
call plug *****begin() 插件启用 Plug 'Valloric/YouCompleteMe' *****启用的插件名称 "Plug 'preservim/nerdtree' call plug *****end()插件启用结束 set number "autocmd vimenter * NERDTree set nocompatible let g:ycm_global_ycm_extra_conf='~/.vim/plugged/YouCompleteMe/.ycm_extra_conf.py' let g:ycm_show_diagnostics_ui = 0 "关闭语法提示 let g:ycm_complete_in_comments=1 " 补全功能在注释中同样有效 let g:ycm_confirm_extra_conf=0 " 允许 vim 加载 .ycm_extra_conf.py 文件,不再提示 let g:ycm_collect_identifiers_from_tags_files=1 " 开启 YCM 标签补全引擎 let g:ycm_min_num_of_chars_for_completion=1 " 从第一个键入字符就开始罗列匹配项 let g:ycm_cache_omnifunc=0 " 禁止缓存匹配项,每次都重新生成匹配项 let g:ycm_seed_identifiers_with_syntax=1 " 语法关键字补全 let g:ycm_goto_buffer_command = 'horizontal-split' " 跳转打开上下分屏 |
保存退出
然后vim进入底行模式,输入 :PlugInstall 进行插件的安装
等待安装完成
Youcomplete离线安装时会报错:
The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library not detected
解决方案:
cd ~/.vim/plugged/YouCompleteMe
./install.py
附vim 插件大全网址:Vim Awesome
VMwaretools灰色无法安装:虚拟机开机瞬间去看VMwaretools工具可以重新安装
关于VMwaretools安装后无法显示共享文件夹解决方案:VMware无法显示共享文件夹(已安装VMware tools)_Kuang915的博客-CSDN博客_vmware共享文件夹不显示
ubuntu源码获取指令:apt install linux-source