sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vimSee https://www.tecmint.com/install-vim-in-linux/
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --config gcc # And make sure gcc-8 is activatedSee https://askubuntu.com/a/1028656/660737
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vimThen add the following to the beginning of your ~/.vimrc:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'- Add the following to your ~/.vimrc
" YouCompleteMe via github
Plugin 'ycm-core/YouCompleteMe'
- Open vim and type
:PluginInstall - You will get an error (YCM core missing or something like that)
- Go to
~/.vim/bundle/YouCompleteMeand install YCM with the module you want, for example:python3 install.py --clangd-completer --clang-tidy - Open vim and type
:PluginInstall
Only if you use cmake:
- Add
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )to yourCMakeLists.txt - Rebuild your compilation chain:
rm -fr build && cmake -S . -B build - Link the compilation dabase to the root of your project:
ln -s build/compile_commands.json . - Add
compilation_commands.jsonto your.gitignore
For more details or if you do not use cmake: https://github.com/ycm-core/YouCompleteMe#option-1-use-a-compilation-database