Install the YouCompleMe plug-in Vim in Ubuntu 14.04

Source: Internet
Author: User

Install the YouCompleMe plug-in Vim in Ubuntu 14.04

For the most authoritative original steps, refer to README. md of this plug-in github. If time permits, read the plug-in several times as much as possible to avoid unnecessary troubles.

Version Check. Generally, all new systems are satisfied. Ensure that Vim> = 7.3.584. Support for python.

Step 1: Download The Vundle and YouCompleteMe plug-ins

Enter the following command to download Vundle

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

After the download is successful, modify the. vimrc file under the user root directory and append the following statement:

set nocompatiblefiletype offset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()Plugin 'gmarik/Vundle.vim'Plugin 'Valloric/YouCompleteMe'call vundle#end()filetype plugin indent on

Run Esc in vim and run the following command to install the plug-in:

:PluginInstall

Or enter:

vim +PluginInstall +qall
Step 2: download other necessary files
  • Download the latest version of LLVM

We strongly recommend that you download the compiled second-level file package. If you download the source file and compile it yourself, you will never know what will happen.

Decompress the package to the specified folder. The process is as follows:

cd ~mkdir ycm_tempcd ycm_tempxz -d clang+llvm-3.6.0-x86_64-linux-gnu-Ubuntu-14.04.tar.xztar -xvf clang+llvm-3.6.0-x86_64-linux-gnu-ubuntu-14.04.tar

Change the name of the clang + llvm-3.6.0-x86_64-linux-gnu folder to llvm_root_dir

  • Download the latest cmake version.

We strongly recommend that you download the compiled second-level file package. If you download the source file and compile it yourself, you will never know what will happen.

Connect cmake to/usr/bin. For example, I put it under the Downloads folder, decompress it locally, and link it

tar zxvf cmake-3.2.2-Linux-x86_64.tar.gzln -s /home/li/Downloads/cmake-3.2.2/bin/cmake /usr/bin/cmake
Step 3: Compile the file

Run the following command to compile the file:

cd ~mkdir ycm_buildcd ycm_buildcmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cppmake ycm_support_libs 

In this way, the installation is basically complete.

Step 4: Configure vim

Although the installation and compilation are completed, it is still one step away from the success. You can configure vim (modify. vimrc) as needed. For example, my example is as follows:

Let g: ycm_global_ycm_extra_conf = '/home/li /. vim/bundle/YouCompleteMe /. ycm_extra_conf.pylet g: limit = 1 "syntax keyword completion let g: ycm_confirm_extra_conf = 0" When vim is enabled, you are not asked whether to load ycm_extra_conf.py to configure inoremap <expr> <CR> pum ()? "\ <C-y>": "\ <CR>" "press enter to select the current item set completeopt = longest, menu "makes Vim's completion menu Behavior consistent with general IDE (refer to VimTip1228)
Problems:
  • E492: Not an editor command:

There are many possible causes. For example, I have encountered a permission issue, for the append write permission of. vim

  • Cannot start normally, there are many red errors

There are also many possible causes. For example, I have encountered a problem that the compiler version is not suitable. For example, after gcc5.1.0 compilation and running is complete, I do not know why it is wrong.

  • No. ycm_extra.conf.py File

You can refer to the file prepared by YCM to modify it or use it directly or mine (see the attachment ). Put it in the project root directory or specify a directory, such

$HOME/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py

Of course, remember to modify the line in. vimrc!

  • Other unknown errors

Input in vim

:YcmDebugInfo

View related information

  • If you follow the steps in this tutorial, a large number of errors still occur.

Instead of searching for other tutorials, read README. md in detail.

 

Attachment
# This file is NOT licensed under the GPLv3, which is the license for the rest# of YouCompleteMe.## Here's the license text for this file:## This is free and unencumbered software released into the public domain.## Anyone is free to copy, modify, publish, use, compile, sell, or# distribute this software, either in source code form or as a compiled# binary, for any purpose, commercial or non-commercial, and by any# means.## In jurisdictions that recognize copyright laws, the author or authors# of this software dedicate any and all copyright interest in the# software to the public domain. We make this dedication for the benefit# of the public at large and to the detriment of our heirs and# successors. We intend this dedication to be an overt act of# relinquishment in perpetuity of all present and future rights to this# software under copyright law.## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR# OTHER DEALINGS IN THE SOFTWARE.## For more information, please refer to 

Easy-to-use Vim plug-in: YouCompleteMe

Install the YouCompleteMe plug-in for Vim in Ubuntu 15.04

Vim auto-completion plug-in-YouCompleteMe installation and configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.