多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## github上start数目较多的vim配置 最近在重新配置Vim,也在GitHub上找了三个star和fork数目很高的方案,在这里分享给大家: * [https://github.com/amix/vimrc](https://github.com/amix/vimrc) - star 3,482 ; Fork 1,203 * [https://github.com/humiaozuzu/dot-vimrc](https://github.com/humiaozuzu/dot-vimrc) - star 781 ; Fork 304 * [https://github.com/spf13/spf13-vim](https://github.com/spf13/spf13-vim) - star 5,287 ; Fork 1,593 * https://github.com/chxuan/vimplus ## 我是用的是vimplus GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux ### 安装vimplus ``` // 原来的链接 git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus cd ~/.vimplus ./install.sh //不加sudo ``` ### 设置Nerd Font 为防止vimplus显示乱码,需设置mac终端字体为`Droid Sans Mono Nerd Font`。 ### 更新vimplus 紧跟vimplus的步伐,尝鲜新特性 ``` ./update.sh ``` ## 出现过的问题 ### YCM编译错误 出现过问题”YouCompleteMe 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 ``` ### ubuntu16.04 更新安装vimplus不成功 ``` sudo apt install --only-upgrade gnupg ``` ## C++头文件找不到 vimplus安装完毕之后,`~`目录下将会生成两个隐藏文件分别是.vimrc和.ycm_extra_conf.py,其中.vimrc是vim的配置文件,`.ycm_extra_conf.py`是ycm插件的配置文件,当你需要创建一个project时,**需要将.ycm_extra_conf.py拷贝到project的顶层目录,通过修改该配置文件里面的`flags`变量来添加你的第三方库路径。** ## Ubuntu16.04安装vimplus所遇到的坑 ### CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release 卸载python2只需一条语句就可以实现 ``` sudu apt-get remove python ``` ubuntu下安装python3 ``` sudo apt-get install python3 ``` 但这样只安装了python3.4 要想使用python3.5,则必须升级python3.4 ``` sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update sudo apt-get install python3.5 ``` 使用以上三行命令便可升级python3.4到python3.5 启动时要输入python3.5 输入python时启动的是python2.7 输入python3时启动的是python3.4 输入python3.5时启动的才是python3.5