按照网上的教程安装该软件,没有一篇是成功的(也有可能是没找对)。自己从网上东拼西凑的,终于让自己的vim智能识别了。
1. 升级 vim: (ubuntu)
sudo add-apt-repository ppa:jonathonf/vim sudo apt update sudo apt install vim 2. 安装vundlegit clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle 3.下载ycmcd ~/.vim/git clone --recursive https://github.com/Valloric/YouCompleteMe.gitcd ~/.vim/bundle/YouCompleteMe
git submodule update --init --recursive
4. 安装libclang
apt-get install llvm-3.9 clang-3.9 libclang-3.9-dev libboost-all-dev
5. 编译ycm_core库mkdir 123 && cd 123 cmake -G "Unix Makefiles" -DUSE_SYSTEM_BOOST=ON -DUSE_SYSTEM_LIBCLANG=ON . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp或者
cmake -G "Unix Makefiles" -DUSE_SYSTEM_BOOST=ON -DEXTERNAL_LIBCLANG_PATH=/usr/lib/x86_64-linux-gnu/libclang-3.9.so . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp #未验证 cmake --build . --target ycm_core --config Release 6. 配置#perl警告处理echo "export LC_ALL=C" >> /root/.bashrcsource /root/.bashrc cp ~/.vim/bundle/YouCompleteMe/third_party/ycmd/examples/.ycm_extra_conf.py ~/.vim/ 配置vimrc"~/.vimrclet g:ycm_server_python_interpreter=‘/usr/bin/python2.7‘ " 当时编译python的版本let g:ycm_global_ycm_extra_conf=‘~/.vim/.ycm_extra_conf.py‘ set nocompatible " be iMprovedset rtp+=~/.vim/bundle/vundle/call vundle#rc() "let Vundle manage Vundle" required!Bundle ‘scrooloose/syntastic‘Bundle ‘gmarik/vundle‘ " My bundles here:"" original repos on GitHubBundle ‘tpope/vim-fugitive‘Bundle ‘Lokaltog/vim-easymotion‘Bundle ‘rstacruz/sparkup‘, {‘rtp‘: ‘vim/‘}Bundle ‘tpope/vim-rails.git‘" vim-scripts reposBundle ‘L9‘Bundle ‘FuzzyFinder‘" non-GitHub reposBundle ‘git://git.wincent.com/command-t.git‘" Git repos on your local machine (i.e. when working on your own plugin)Bundle ‘file:///Users/gmarik/path/to/plugin‘" ...Bundle ‘Valloric/YouCompleteMe‘filetype plugin indent on " required!" 编码为utf-8set fileencodings=utf-8,gb2312,gbk,gb18030set termencoding=utf-8set encoding=utf-8 显示结果:
时间: 2024-09-28 19:37:03