Home > System Tutorial > LINUX > body text

How to install YCM on CentOS

王林
Release: 2023-12-29 16:45:40
forward
977 people have browsed it

1. Install vundle

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

2. Configuration.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
Copy after login

3. Open vim and run

:BundleInstall
Copy after login

4. Install necessary tools

1. yum install gcc gcc-c make automake python-devel
2. Install CMake

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

5. Install clang llvm (the compiled one is used here)

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
Copy after login

6. Enter the YCM directory and run

./install.sh –clang-completer
Copy after login

7. Configure ~/.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' : ['.', ':']
\ }
Copy after login

The above is the detailed content of How to install YCM on CentOS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template