zoukankan      html  css  js  c++  java
  • youcompleteme-Vim补全插件安装

    这个补全插件从名字看很腻害了~

    1. 系统环境:ubuntu64,准备安装youcompleteme
    2. 确认Vim版本:打开vim就可以看到版本号了,需要大于7.4.143
    3. 确认Vim支持Python:进入Vim,输入:echo has('python') || has('python3'),结果需要为1
    4. 安装Vundle:git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    5. 编辑~/.vimrc,使用Vundle安装各种插件:
      1  set nocompatible                                                            
      2   filetype off
      3   set rtp+=~/.vim/bundle/Vundle.vim
      4   call vundle#begin()
      5   Plugin 'VundleVim/Vundle.vim'
      6   Plugin 'Valloric/YouCompleteMe'
      7  call vundle#end()
      8  filetype plugin indent on
    6. 再打开Vim,输入:PluginInstall,等待出现done!成功安装标志。
    7. 从http://llvm.org/releases/download.html下载Pre-Built Binaries(clang+llvm),解压进入目录并复制到系统目录,再配置一下软链接,最后确定clang版本号就表明clang是最新版
      1 tar zxvf clang+llvm-3.7.0-amd64-Ubuntu-14.04..tar.gz
      2 cd clang+llvm-3.7.0-amd64-Ubuntu-14.04
      3 sudo cp -R * /usr/
      4 sudo ln -sf /usr/bin/clang++ /etc/alternatives/c++
      5 clang --version
    8.  编译youcompleteme

      1 cd ~/.vim/bundle/YouCompleteMe
      2 mkdir build
      3 cd build
      4 cmake -G "Unix Makefiles" -DUSE_SYSTEM_LIBCLANG=ON . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
      5 make ycm_core -j4  
    9. 配置.ycm_extra_conf.py

      1 echo | clang -v -E -x c++ -
      2 vim ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py
      3 insert flags: ‘isystem', '/usr/include/,(将echo结果写入,最后一个不用‘,’)  
    10. 配置.vimrc
      1 let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'

       好咯,安装就到这了,具体的使用就要常用常查了

  • 相关阅读:
    A1061 Dating [字符串比较]
    A1058 A+B in Hogwarts [进制转换]
    A1027 Colors in Mars[简单模拟--进制转换]
    A1031 Hello World for U[图形输出]
    刷PAT的一些思考—Day 1
    A1009 Product of Polynomials[简单模拟--多项式相乘]
    A1002 A+B for Polynomials[简单模拟--多项式相加]
    A1046 Shortest Distance [简单模拟--卡算法复杂度]
    1009 说反话
    usb之配置描述符
  • 原文地址:https://www.cnblogs.com/mantouRobot/p/6121423.html
Copyright © 2011-2022 走看看