Setting up VIM for mainstream code editing

Santhosh Reddy
2 min readJul 12, 2018

--

Let’s not get into the argument whether IDE is better or some decent text editors like sublime, vim etc. If you landed on this page, I am assuming you are convinced that you should be using VIM editor instead of IDE for whatever reason. So, without further ado, I will walk you through the steps for setting VIM close to IDE in-terms of usable features.

VIM like an IDE

To setup VIM like an IDE, we will be using a plugin manager vim-plug. Make sure you have installed the same.

curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Once you have installed VIM plug, let’s first add a theme to our VIM. For this add below lines in you .vimrc file located in your home directory. From now on, if you have added any plugins in below code, you have to close and reopen you .vimrc file and then do :PlugInstall .

call plug#begin('~/.vim/plugged')Plug 'cocopon/iceberg.vim'call plug#end()

For code auto-completion add below plugin to .vimrc file and install it as mentioned above.

Plug 'Valloric/YouCompleteMe', { 'do': './install.py --tern-completer' }

For more details on YouCompleteMe plugin, visit this.

For fuzzy file finding in the project, use below plugin.

Plug 'kien/ctrlp.vim'

Below is the list of all the plugins that make your life easy with vim.

Plug 'Valloric/YouCompleteMe', { 'do': './install.py --tern-completer' }Plug 'tpope/vim-fugitive'Plug 'airblade/vim-gitgutter'Plug 'scrooloose/nerdtree'Plug 'kien/ctrlp.vim'Plug 'mhinz/vim-grepper'

Check out this link for details on the above plugins. Below is my .vimrc file for your reference.

Happy Coding!

--

--