In these article we install plugins for:
The procedures were performed on Ubuntu Cinnamon
sudo apt update && \
sudo apt upgrade -y && \
sudo apt clean && \
sudo apt autoclean && \
sudo apt autoremove -y
sudo apt install vim curl git wget
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Add to
~/.vimrc
The plugin https://github.com/terroo/vim-simple-emoji will be used to test if everything is working.
call plug#begin('~/.vim/plugged')
" Here will be only plugins
" Sample initial plugin
Plug 'terroo/vim-simple-emoji'
call plug#end()
Close ~/.vimrc
and open it again and then run:
:PlugInstall
Test to see if it’s working:
vim test.md
Type :smile:
and give space then, if the face appears: 😃 it’s because everything is right! Or run :ShowEmoji
.
git clone https://github.com/terroo/fonts
cd fonts
mv fonts ~/.local/share/fonts
cd && rm -rf fonts
fc-cache -fv
Plug 'matsuuu/pinkmare'
colorscheme pinkmare " OPTIONAL: hi! MatchParen cterm=NONE,bold gui=NONE,bold guibg=NONE guifg=#FFFF00
set nu!
set mouse=a
set title
set cursorline
set encoding=utf-8 " Important to YCM
map q :quit<CR> " for quit only type q on command mode
" for save using Ctrl + s on command mode
" Need run this command: echo 'stty -ixon' >> ~/.bashrc && exec $SHELL
map <C-s> :write<CR>
sudo apt install gcc g++ cmake make build-essential vim-nox python3-dev
.vimrc
: Plug 'ycm-core/YouCompleteMe'
cd .vim/plugged/YouCompleteMe/
python3 install.py --clangd-completer # Only C/C++
# python3 install.py --all # Need Go and NPM:
# sudo apt install golang npm
~/.vim/.ycm_extra_conf.py
vim ~/vim/.ycm_extra_conf.py
'-I/usr/include/gtkmm-3.0',
'-I./',
'-I/usr/include'
vim test.cpp
I came testing.cpp
#include <iostream>
and #include <vector>
it will autocomplete! If not, add this line to your ~/.vimrc
let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py'
set completeopt-=preview
let g:ycm_show_diagnostics_ui = 0
Compiling:
:terminal
andg++ test.cpp
, to exit the terminal: exit.
Plug 'jiangmiao/auto-pairs'
sudo apt install ccls
Copy this code and paste into your ~/.vimrc
let g:ycm_language_server =
\ [{
\ 'name': 'ccls',
\ 'cmdline': [ 'ccls' ],
\ 'filetypes': [ 'c', 'cpp', 'cc', 'h', 'hpp' ],
\ 'project_root_files': [ '.ccls-root', 'compile_commands.json' ]
\ }]
Note that when autocompleting now it automatically adds a header, if you don’t want that to happen, add this line to your
.vimrc
:let g:ycm_clangd_args=['--header-insertion=never']
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'ervandew/supertab'
To work add this code:
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:SuperTabDefaultCompletionType = '<C-n>'
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
Edit snippets in:
.vim/plugged/vim-snippets/UltiSnips/cpp.snippets
or.vim/plugged/vim-snippets/snippets/cpp.snippets
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
:AirlineTheme
:help AirLineTheme
let extension = expand('%:e')
if( extension == "cpp" || extension == "cc" || extension == "h" || extension == "hpp" )
Plug 'ycm-core/YouCompleteMe'
else
Plug 'zxqfl/tabnine-vim'
endif
If you want to see all the steps above on video I recommend watching the video below. However, the video is in Brazilian Portuguese, but you will be able to follow the commands and settings without any problems.