Vim plugin YouCompleteMe installation records (known as the hardest Vim plugin installed?)

Use PulginInstall installation not in order, if you do not, then the ladder

Own ssr been sealed, using ss colleagues, but encryption colleagues set ss applications on linux does not support ...

 

Well, directly on the process

1. First to get YouCompleteMe code

~ CD / .vim / the bundle 

# pull YouCompleteMe item code 
Git clone HTTPS: // github.com/ycm-core/YouCompleteMe.git 

# enter the directory 
CD YouCompleteMe 

# mounted submodule 
Git submodule Update --init --recursive

Here there will be sub-module installation

fatal: Unable to Access ' https://go.googlesource.com/tools/ ' : Connect to the Failed to go.googlesource.com Port 443 : Connection Timeout 
fatal: not clone ' https://go.googlesource.com/tools ' to the sub-module path ' /home/zyj/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go/src/golang.org/x/tools '

The reason go.googlesource.com domestic domain name can not be accessed directly, this time based on the path behind   /home/zyj/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go/src/golang.org/x/tools  to know to put this module is the path

The module is to find the path to download on github

cd ~/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/go/src/golang.org/x

git clone https://github.com/golang/tools.git

Back YouComplateMe directory continue to install other sub-modules

~ CD / .vim / the bundle / YouCompleteMe 

# continue sub-module installation 
Git submodule Update --init --recursive

 

2. Go to a directory you like, such as the user's home directory

~ cd 

# Create a directory used to store the next step is to compile the code directory 
mkdir ~ / .ycm_build 

# enter the directory 
cd ~ / .ycm_build 

# compiler output to the current directory (.ycm_build) 
cmake -G " Unix Makefiles " . ~ / .vim / bundle / YouCompleteMe / third_party / YCMD / cpp

2.1 If you need the relevant functional and practical C language family (I have here the system comes llvm 3.8, clang 3.8, libclang no, libboost-all-dev is not), then you do not need to skip 2.1

sudo apt install llvm-3.9 clang-3.9 libclang-3.9-dev libboost-all-dev

2.2 compiler YouComplateMe

# 2.1 skips execution 
CMake -G "the Unix the Makefiles." ~ / .Vim / the bundle / YouCompleteMe / THIRD_PARTY / YCMD / CPP

# 2.1 executed perform
cmake -G "Unix Makefiles" -DUSE_SYSTEM_BOOST = ON -DUSE_SYSTEM_LIBCLANG = ON. ~ / .vim / bundle / YouCompleteMe / third_party / ycmd / cpp

You can see ~ / .ycm_build directory structure (I did not skip 2.1, if you skip maybe there is not the same, as long as no error during compilation no problem)

Under # zsh l ls -al equal at the bash 
L ~ / .ycm_build total amount of 72K drwxr -XR-X . 5 ZYJ ZYJ . 4 .0K July 18 is . 19 : 00 . Drwxr -XR X- 46 is ZYJ ZYJ . 4 .0K July 18 is . 19 : 35 .. drwxr -XR-X . 3 ZYJ ZYJ . 4 .0K. 7 dated 18 is . 19 : 00 BoostParts -rw-R & lt - r-- . 1 ZYJ ZYJ 18K. 7 dated 18 is . 19 : 00 CMakeCache.txt drwxr-xr-x 4 zyj zyj 4.0K 7月 18 19:03 CMakeFiles -rw-r--r-- 1 zyj zyj 1.6K 7月 18 19:00 cmake_install.cmake -rw-r--r-- 1 zyj zyj 19K 7月 18 19:00 compile_commands.json -rw-r--r-- 1 zyj zyj 4.1K 7月 18 19:00 Makefile drwxr-xr-x 3 zyj zyj 4.0K 7月 18 19:00 ycm

2.3 2.2 The above intermediate was constructed only to compile, execute the following final compiled

# If you are not a window system, you can remove the --config Release 
cmake --build. --Target ycm_core --config Release

Compilation process is as follows:

[  4%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Candidate.cpp.o
[  8%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CandidateRepository.cpp.o
[ 12%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Character.cpp.o
[ 16%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CharacterRepository.cpp.o
[ 20%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangCompleter.cpp.o
[ 24%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangHelpers.cpp.o
[ 28%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangUtils.cpp.o
[ 32%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/CompilationDatabase.cpp.o
[ 36%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/CompletionData.cpp.o
[ 40%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/Documentation.cpp.o
[ 44%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/Range.cpp.o
[ 48%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnit.cpp.o
[ 52%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnitStore.cpp.o
[ 56%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CodePoint.cpp.o
[ 60%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CodePointRepository.cpp.o
[ 64%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierCompleter.cpp.o
[ 68%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierDatabase.cpp.o
[ 72%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o
[ 76%] Building CXX object ycm/CMakeFiles/ycm_core.dir/PythonSupport.cpp.o
[ 80%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Result.cpp.o
[ 84%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o
[ 88%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Word.cpp.o
[ 92%] Building CXX object ycm/CMakeFiles/ycm_core.dir/versioning.cpp.o
[ 96%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o
[100%] Linking CXX shared library /home/zyj/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so
[100%] Built target ycm_core

Then after speaking to compile files into the directory you want to put the

cp ~/.vim/bundle/YouCompleteMe/third_party/ycmd/examples/.ycm_extra_conf.py ~/.vim/

Then the python and written to ~ / .vimrc, the location of the file you are free enough

let g:ycm_server_python_interpreter='/usr/bin/python'
let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'

Then try to write a file, right

hello.c vim 

# reported the following error, but still press any key to enter the editor, but does not take effect ycm 
YouCompleteMe unavailable Sign of the: The requires Vim Compiled with Python ( 2.7 . 1 + or 3.4 + ) Support. 
YouCompleteMe unavailable Sign of the: Unable to load Python.

Found on github issue YouComplate of solutions , principles and I do not know

sudo apt install vim-gtk 

Then just fine, no error prompt re-enter edit, YCM also normally come into force

Now, happy beginning of your code!

 

Reference: https://www.jianshu.com/p/d908ce81017a?nomobile=yes 

 

Guess you like

Origin www.cnblogs.com/YMaster/p/11209813.html