Vim8 and youcompleteme installation

Time:2020-2-27

Original link: https://ssshooter.com/2020-01

The whole process is not difficult, but I am very strange to Linux system. I am a bit confused when compiling and installing. But after the installation, I think it’s not difficult if I don’t go deep into the principle. It’s very common to compile the configured source code with a compiler, and then run the program. In fact, I don’t need to do anything difficult.

VIM 8 installation

As a matter of fact, users of CentOS 7.5 who eat shrivels don’t directly install VIM 8. Although Baidu can go to a solution of changing warehouse and then yum, unfortunately, that warehouse has already 404.

Therefore, we can only use the source code honestlymakeNow.

First, pull the official warehouse of vim: https://github.com/vim/vim

Cut in: there’s a very hot place here. Tencent cloud clone GitHub warehouse is so fast. I have to pull the GitHub warehouse once in gitee, and then clone gitee is the solution to save the nation Warehouse, but this is not omnipotent, because in some cases, you can’t pull other library codes in one library, which is more troublesome.

Suppose that the warehouse has been pulled and entered the SRC folder of the warehouse:

cd src

Then configure the installation,You can’t use youcompleteme without this(my broken machine is py2.7, and I don’t want to toss and update, so I just use 2.7.)

If there is no configuration, a prompt like this will pop up,YouCompleteMe unavailable: requires Vim compiled with Python ...Don’t ask me how I know

./configure --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config

It should be noted that the address of Python config dir is not correct.You may need to install the compiler after configurationyum install gcc-c++(the solution found by the search engine may include other things. If not, install it again). Then run:

make && make install

After the compilation is successful, thesrcDirectory operationvimYou can open the latest version of vim. If you feel inconvenient, you can$PATH Add environment variables

Then install the plug-in manager (vimplug, etc.) and edit the configuration file vimrc. It’s not very difficult, so we won’t expand it here.

Youcompleteme installation

Here use vimplug as an example to install youcompleteme.

The first step is the same as ordinary plug-ins:

Plug 'valloric/youcompleteme'

Run pluginstall in VIM after configuration.

Step two, because of thisPlug ins also need to be compiled to use, so we need to install anothercmakeCompiler.

The third step is to open the folder of your complete me (if vimplug is used, it should be in the~/.vim/plugged/youcompletemeOperation./install.py

Add in: install needs to pull several dependent projects first. These projects are naturally stored in GitHub. It is also said that Tencent cloud pull GitHub warehouse is really slow, so this step has been a long time.

At this point, you can use it normally, but you can still optimize the plug-in to your most convenient appearance through configuration.

As far as JavaScript users are concerned, you can see youcompleteme (JavaScript and typescript semantic completion)

Finally, I recommend a place to find plug-ins: vimawesome