Youcompleteme Introduction
Youcompeteme Plugin official address: Github.
The Youcompleteme is a very powerful auto-completion plugin, such as:
Detailed introduction can refer to the blog post vim automatic plug-in Youcomplete installation and configuration.
Youcompleteme installation Check VIM version
Youcompleteme requires VIM version greater than or equal to 7.3. Check the VIM version command as follows:
1 Vim--version
Installing CMake
1 sudo Yum Install CMake
Compiling and installing Llvm-clang
Download the latest LLVM, clang and Auxiliary Library source code available:
1CD ~/llvm-clang2SVN Co http://Llvm.org/svn/llvm-project/llvm/trunk LLVM3CD llvm/Tools4SVN Co http://llvm.org/svn/llvm-project/cfe/trunk clang5Cd.. /..6CD llvm/tools/clang/Tools7SVN Co http://Llvm.org/svn/llvm-project/clang-tools-extra/trunk Extra8Cd.. /.. /.. /..9CD llvm/ProjectsTenSVN Co http://Llvm.org/svn/llvm-project/compiler-rt/trunk Compiler-rt OneCd..
Return to the ~/llvm-clang directory and create a new directory Llvm-build dedicated to compiling Llvm-clang, so that no source code.
1 mkdir llvm-build2 cd llvm-build/3 : /llvm/configure--enable-optimized--enable-targets=host-only--prefix=/usr/clang
Building a compilation environment
After this configuration, where--prefix specifies the Llvm-clang installation directory
Input
1 Make // Start compiling 2 sudo Make Install // to install
If you want to uninstall, enter it in this directory
1 sudo Make Uninstall
When installed, enter
1 // To view version information:
Installing the Clang standard library
Clang's standard library ———— libc++ (interface layer) and Libc++abi (Implementation layer) require installation of header files and dynamic-link libraries (*.so).
Installing libc++
1 cd ~/llvm-clang2 SVN Co http://Llvm.org/svn/llvm-project/libcxx/trunk Libcxx3 cd libcxx/lib4 ./buildit
The header file has been generated to ~/llvm-clang/libcxx/include/, so clang must be copied to/usr/include/c++/v1/
1 sudo CP -R ~/llvm-clang/libcxx/include//usr/include/c++/v1/
*.so file has been generated ~/llvm-clang/libcxx/lib/libc++.so.1.0, to make clang access must be copied to/usr/lib/and create a soft link
1 Ln -S ~/llvm-clang/libcxx/lib/libc++.so. 1.0 ~/llvm-clang/libcxx/lib/libc++.so. 1 2 Ln -S ~/llvm-clang/libcxx/lib/libc++.so. 1.0 ~/llvm-clang/libcxx/lib/libc++.so3sudocp ~/llvm-clang/libcxx/ lib/libc++.so*/usr/lib/
Similarly, the source code installs the Libc++abi header file and the dynamic link library:
1 cd ~/llvm-clang/2 SVN Co http://Llvm.org/svn/llvm-project/libcxxabi/trunk Libcxxabi3 cd libcxxabi/lib4 ./buildit
The header file has been generated to ~/llvm-clang/libcxxabi/include/, so clang must be copied to/usr/include/c++/v1/
1 CP -R ~/llvm-clang/libcxxabi/include//usr/include/c++/v1/
*.so file has been generated ~/llvm-clang/libcxx/lib/libc++abi.so.1.0, to make clang access must be copied to/usr/lib/and create a soft link
1 Ln -S ~/llvm-clang/libcxxabi/lib/libc++abi.so. 1.0 ~/llvm-clang/libcxxabi/lib/libc++abi.so. 1 2 Ln -S ~/llvm-clang/libcxxabi/lib/libc++abi.so. 1.0 ~/llvm-clang/libcxxabi/lib/libc++abi.so3sudocp ~/llvm-clang/ libcxxabi/lib/libc++abi.so*/usr/lib/
Installing the Python development environment
If the system does not have Python installed, you need to install:
1 sudo Yum Install Python-devel
Installing Vundle
Vundle is the plug-in management plugin for Vim, please refer to Vundle official website for detailed installation.
Installing Youcompleteme
Download Youcompleteme Source:
1 git clone https://github.com/valloric/youcompleteme.git ~/.vim/bundle/youcompleteme
Then add the following in the VIMRC file:
1 ' Valloric/youcompleteme '
Execute command:
CD ~/.vim/bundle/youcompleteme. /Install. SH --clang-completer
Youcompleteme Configuration
The following configuration is excerpted from the blog post vim automatic plug-in Youcomplete installation and configuration.
1 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""2 "= = youcompleteme Code Auto-Complete3 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""4Bundle'Valloric/youcompleteme'5 "youcompleteme default tab s-tab and auto-complete conflicts6 "Let g:ycm_key_list_select_completion=[' <c-n> '7 "Let g:ycm_key_list_select_completion = [' <Down> ']8 "Let g:ycm_key_list_previous_completion=[' <c-p> '9 "Let g:ycm_key_list_previous_completion = [' <Up> ']TenLet g:ycm_confirm_extra_conf=0 "close load. ycm_extra_conf.py Tips OneLet g:ycm_complete_in_comments =1 "can also be complete in the comment input ALet g:ycm_complete_in_strings =1 "can also be complete in string input -Let g:ycm_collect_identifiers_from_tags_files=1 "turn on the YCM tag engine -Let g:ycm_collect_identifiers_from_comments_and_strings =1 "text in comments and strings is also fully paid theLet g:ycm_seed_identifiers_with_syntax=1 "language keyword completion, but the Python keyword is very short, so, need to open their own -Let G:ycm_collect_identifiers_from_tags_files =1 -Let g:ycm_min_num_of_chars_for_completion=2 "Type a character from the 2nd to start listing matches - "introduced, can complement the system, and Python's third-party package is compatible with the new and old versions of YCM + "Old version - if!empty (Glob ("~/.vim/bundle/youcompleteme/cpp/ycm/.ycm_extra_conf.py")) +Let g:ycm_global_ycm_extra_conf ="~/.vim/bundle/youcompleteme/cpp/ycm/.ycm_extra_conf.py" A endif at "New version - if!empty (Glob ("~/.vim/bundle/youcompleteme/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py")) -Let g:ycm_global_ycm_extra_conf ="~/.vim/bundle/youcompleteme/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py" - endif - - "Mapping inNmap <leader>gd:YcmDiags<CR> -Nnoremap <leader>gl:ycmcompleter gotodeclaration<cr>"jump to the Declaration office toNnoremap <leader>gf:ycmcompleter gotodefinition<cr>"jump to Definition +Nnoremap <leader>gg:ycmcompleter gotodefinitionelsedeclaration<cr> - the "Direct trigger Auto-complete *Let g:ycm_key_invoke_completion ='<C-Space>' $ "blacklist, do not enablePanax NotoginsengLet g:ycm_filetype_blacklist = { -\'Tagbar':1, the\'Gitcommit':1, +\}
Resources
Vim under the auto-completion plug-in Youcomplete installation and configuration
Youcompleteme official website
Vim AutoComplete plugin Youcompleteme installation and configuration under CentOS 7