System version: Manjaro 20.0.3 Lysia
desktop environment: Gnome
(I was Manjaro system, installed with the Ubuntu command is not the same, with the Ubuntu installation command only the following pacman -Sy
into apt install
it)
Need to install vim, git, gcc, python3 first
sudo pacman -Sy vim git gcc
Install vim plugin
sudo pacman -S vim-youcompleteme-git
I strongly recommend this super easy-to-use vim plugin environment on Github : chxuan/vimplus , installation steps:
git clone https://github.com/chxuan/vimplus.git ~/.vimplus
cd ~/.vimplus
./install.sh
Yes, it has been installed~
Into the YouCompleteMe
folder to begin installation YouCmopleteMe
cd ~/.vim/plugged/YouCompleteMe
git submodule update --init --recursive
python3 ./install.py -all
Install the Java interpreter, only the ./install.sh
add back --java-completer
on it, you need to install jdk8
(if you want to support JavaScript and TypeScript, will be replaced by --ts-completer
a detailed look at the following installation steps: YCM-Core / YouCompleteMe )
sudo pacman -S jdk8-openjdk
./install.sh --java-completer
Download vim plugin manager: Vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Start to modify the vim configuration file:~/.vimrc
vim ~/.vimrc
Entering .vimrc
After pressing :
input 170
, press 回车
, jumps to line 170.
After pressing the i
key insertion operation, paste the following into it (the best line up and down to stay free, easy to navigate), this step is to allow vim support vundle , and install some plugins.
" Vundler (set the runtime path to include Vundle and initialize)
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'mzlogin/vim-markdown-toc'
Plugin 'zxqfl/tabnine-vim'
call vundle#end() " required
Press the ESC
button to enter :wq
, save and exit.
Terminal input vim
into the vim, enter the :PluginInstall
start to install the plug
(total downloaded files are large, because tabnine relatively large, need to wait for some time, I downloaded a few minutes to download complete).
Start to install the machine learning grammar prompt artifact
# 安装 YouCompleteMe
cd ~/.vim/plugged/YouCompleteMe
./install.sh
# 安装 tabnine
cd ~/.vim/bundle/tabnine-vim/
./install.sh
ok
Troubleshoot installation --java-completer
download speed is too slow problem, download when you can see there is a download of information jdt.ls
Downloading jdt.ls from http://download.eclipse.org/jdtls/milestones/0.40.0/jdt-language-server-0.40.0-201906040221.tar.gz...
Press the Ctrl key and click the link, or copy the link and paste it into the browser, download the compressed file, and then enter the YouCompleteMe plug-in folder, there will be a download cache location, for example, Java is in the YouCompleteMe directory the ./third_party/ycmd/third_party/eclipse.jdt.ls/target/cache
folder, and paste the file into it, you can re-run the install command
# 进入这个文件夹内
cd /home/z/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/eclipse.jdt.ls/target/cache
# 将文件粘贴到这个文件夹内
cp ~/Download/jdt-language-server-0.40.0-201906040221.tar.gz ./
# 重新运行安装
cd ~/.vim/plugged/YouCompleteMe
./install.sh --java-completer
Related Links:
-
You can read this article to learn how to use Vundle: How to use Vundle to manage Vim plugins on Linux
-
You can follow the steps in this blog to install: VIM automatic configuration (code completion, code highlighting, symbol completion, etc.)