zoukankan      html  css  js  c++  java
  • Vim中YouCompleteMe插件安装

    背景

    YouCompleteMe需要使用GCC进行编译,然而Centos 6.7默认的GCC版本太低,所以需要使用devtools-2,用来安装多个版本GCC手动编译安装GCC的坑简直不要太多(类似于rvm)。

    升级GCC版本

    wget http://people.centos.org/tru/devtools-2/devtools-2.repo -P /etc/yum.repos.d
    yum install -y devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-gfortran devtoolset-2-gcc-c++
    scl enable devtoolset-2 bash
    

    OK,现在查看GCC版本信息如下【默认是4.4.7】:

    gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
    Target: x86_64-redhat-linux
    Configured with: ../configure --prefix=/opt/rh/devtoolset-2/root/usr --mandir=/opt/rh/devtoolset-2/root/usr/share/man --infodir=/opt/rh/devtoolset-2/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/dev/shm/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/isl-install --with-cloog=/dev/shm/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/cloog-install --with-mpc=/dev/shm/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
    Thread model: posix
    gcc version 4.8.2 20140120 (Red Hat 4.8.2-15) (GCC)
    

    下载YouCompleteMe插件

    在~/.vimrc中增加一行 Plugin 'Valloric/YouCompleteMe' ,保存后执行命令PluginInstall

    编译YouCompleteMe

    执行下面命令

    cd ~/.vim/bundle/YouCompleteMe && ./install.py
    

    OK,现在YouCompleteMe插件可以正常工作了。

    注意事项

    • 因为我的Centos安装了python 2.7(千万不要删除python2.6,因为yum绑定了python2.6),所以无法确定默认的python 2.6能否正确执行上述步骤,如遇到错误,可以安装一个2.7的python。
    • 安装了python 2.7后,如果yum无法使用了,可以编辑/usr/bin/yum,将/usr/bin/python替换为/usr/bin/python2.6
  • 相关阅读:
    前端学习笔记2017.6.12 DIV布局网页
    前端学习笔记2017.6.12 HTML的结构以及xhtml、html、xml的区别
    前端学习笔记2017.6.21-html和浏览器的关系以及开发工具
    前端学习笔记2017.6.21-html是个什么东西
    前端学习笔记2017.6.21-引入JS文件的方法
    学习一下阿里技术文档的写作方法
    PS中图层混合模式的计算方法
    3dsmax里面的喷射器spray和超级喷射器superspray是个什么东西
    案例14-实现注册功能和激活功能
    012-MD5Utils工具类模板
  • 原文地址:https://www.cnblogs.com/zhangyanpei/p/6277079.html
Copyright © 2011-2022 走看看