The .vimrc contains my lightweight customized vim configuration.
It contains some useful plugins (NERDTree, CtrlP, YCM) and some handy settings and key mappings.
It will give you directory navigation tools, autocompletion, an updated status bar, and more.
You'll need vim-plug. To install it, open a terminal window and execute:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
For Neovim or Windows users, instructions are available here: https://github.com/junegunn/vim-plug
Installing this configuration is easy:
- Clone this repository and copy the .vimrc file to your home directory.
- Open vim.
- The plugins should install automagically.
All done!
(If you want to use YCM, read the next section.)
To install and use YCM, you'll need cmake. In a terminal execute sudo apt-get install cmake
Once you've done that, navigate to ~/.vim/plugged/YouCompleteMe and execute install.py
In order to use YCM autocompletion with C and C++, you will need clang v3.8 or later.
In a terminal window execute: sudo apt-get install libclang-dev
Then navigate to ~/.vim/plugged/YouCompleteMe and execute install.py --clang-completer
You'll also need to define compilation flags for YCM to reference for each project.
Information on how to achieve this can be found here: https://github.com/Valloric/YouCompleteMe/blob/master/README.md#c-family-semantic-completion
To get up and running fast:
- Create a .ycm_extra_conf.py Python script in your project's root directory.
- Add this to function it:
- Save and close.
You should now have autocompletion for your C and C++ projects.