怎么在CentOS中安装YCM

发布时间:2021-03-12 14:52:51 作者:Leah
来源:亿速云 阅读:229

今天就跟大家聊聊有关怎么在CentOS中安装YCM,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

1、安装vundle 

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

2、配置.vimrc

set nocompatible  
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
call vundle#end()     
Bundle 'Valloric/YouCompleteMe'
filetype plugin indent on

3、打开vim运行

:BundleInstall

4、安装必要工具

1、yum install gcc gcc-c++ make automake python-devel
2、安装CMake

wget http://www.cmake.org/cmake/resources/software.html 
tar -zxv -f cmake-*.*.*.*.tar.gz 
cd cmake-*.*.*.*.tar.gz 
./bootstrap 
gmake 
gmake install

5、安装clang+llvm(这里用已经编译好的)

1、wget http://llvm.org/releases/3.5.1/clang+llvm-3.5.1-x86_64-fedora20.tar.xz
xz -d clang+llvm-3.5.1-x86_64-fedora20.tar.xz
tar xvf clang+llvm-3.5.1-x86_64-fedora20.tar
cd clang+llvm-3.5.1-x86_64-fedora20
注:也可用tar xvf clang+llvm-3.5.1-x86_64-fedora20.tar.xz解压

2、在/etc/profile这个档案最尾端添加以下两行代码:

PATH=/usr/local/cmake/bin:/usr/clang_3_3/bin:$PATH
export PATH

3、执行更新变量:source /etc/profile

6、进入YCM目录,运行

./install.sh –clang-completer

7、对~/.vimrc做配置

let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/y   cmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf = 0

let g:ycm_semantic_triggers = {
  \   'c' : ['->', '    ', '.', ' ', '(', '[', '&'],
\     'cpp,objcpp' : ['->', '.', ' ', '(', '[', '&', '::'],
\     'perl' : ['->', '::', ' '],
\     'php' : ['->', '::', '.'],
\     'cs,java,javascript,d,vim,python,perl6,scala,vb,elixir,go' : ['.'],
\     'ruby' : ['.', '::'],
\     'lua' : ['.', ':']
\ }

看完上述内容,你们对怎么在CentOS中安装YCM有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注亿速云行业资讯频道,感谢大家的支持。

推荐阅读:
  1. 在CentOS 安装Webmin
  2. 怎样在centos中安装docker

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

centos ycm

上一篇:怎么在CentOS中添加IP地址

下一篇:discuz百度快照被劫持如何解决

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》