Turn Vim into a comfy and modern editor with these plugins! 🛋
Tags: vim, cpp, productivity
Published: 2020-11-03 18:06:24

<span>Photo by <a href="https://unsplash.com/@max_duz?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Max Duzij</a> on <a href="https://unsplash.com/s/photos/code?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>

For the last 2 years, I've been in a loving relationship with Vim's modal editing, but my actual setup has changed a lot with time (not even always using Vim itself), as, let's face it, out-of-the-box Vim is pretty lacking for anything else than a quick edit of a couple of files. 

Nowadays, I managed to create a comfy config that can even rival with VSCode (my other great love). These are the plugins I'm using atm, but I keep a more up to date version [here](https://github.com/javiersalcedopuyo/DOT-Files).

# 🏖 Quality of life plugins
First, the things that make my day to day easier, and take Vim from an old clunky command line notepad, into a modern and powerful tool.
* [Vim-Plug](https://github.com/junegunn/vim-plug): A really simple and easy to use plugin manager. 
* [Airline](https://github.com/vim-airline/vim-airline): A lightweight status line.
* [SuperTab](https://github.com/ervandew/supertab): Use Tab for navigate autocomplete suggestions.
* [FzF](https://github.com/junegunn/fzf.vim): Fuzzy finding of files by name, with a really useful preview. 
* [The Silver Searcher](https://github.com/ggreer/the_silver_searcher): Not really a plugin, but a great companion for FzF. Gives you a better way to search for text _inside_ the files.
  * __Bonus__: [Skim](https://github.com/lotabout/skim.vim): Rust version of FzF 🦀! Way faster, but I find the Silver Searcher integration unreliable. For now I have both installed, Skim for searching files and FzF + Silver Searcher for searching -_into_ files.

* [CoC-Pairs](https://github.com/neoclide/coc-pairs): Not a Vim plugin, but a _CoC_ one. Auto pairs like in VSCode.
* [Signify](https://github.com/mhinz/vim-signify): Until very recently, I used [GitGutter](https://github.com/airblade/vim-gitgutter), but in my current role we use SVN, so I switched to Signify. It is essentially the same, but not limited to Git. Basically, it shows markers of line beside the line number, allows to jump between them, preview, undo, etc.
* [Fugitive](https://github.com/tpope/vim-fugitive): Git tools. I don't really use it that much lately, but it deserves a mention.
* [Surround](https://github.com/tpope/vim-surround): A classic. Quickly add/replace surrounding text.
* [Multiple Cursors](https://github.com/mg979/vim-visual-multi): Sublime Text style multiple cursors.
* [EasyMotion](https://github.com/easymotion/vim-easymotion): One of those plugins that become indispensables. Lets you jump easily to any point of the code.

# 💬 Language plugins
The real core of coding tools: Language-specific tools. Code navigation, autocomplete, etc.
* [Conquer of Completion (CoC)](https://github.com/neoclide/coc.nvim): Intellisense on Vim! 💖 This on itself is just a blank slate. You have to install its own plugins for each language.
* [Polyglot](https://github.com/sheerun/vim-polyglot): Better syntax highlighting for a lot of languages.

Like many of us, I live a double dev life: at work and at home.
My personal projects are usually small and written on C++ or Rust, while my job requires a big code base. 
For my small C++ projects, I find that the Clangd LSP works great.

### 🏡 Home
* [CoC's Rust Analyzer](https://github.com/fannheyward/coc-rust-analyzer): Rust Analyzer is a great Rust LSP. More complete and powerful than the default.
* [CoC's Clangd](https://github.com/clangd/coc-clangd): One of the best C++ LSP IMHO (if you use Clang)
* [GLSL](https://github.com/tikhomirov/vim-glsl): Syntax highlight for GLSL

However, I've failed miserably trying to make it work in my office (It's a huge codebase that takes ~15-20' to compile after all). For that reason, I stepped back into... ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tpg4rp8vo61u7fu4avvu.png) 

### 🏢 Office
* [Gutentags](https://github.com/ludovicchabant/vim-gutentags): Automates the generation of the tags, for a more IDE-like feel.
* [Universal Ctags](https://ctags.io/): Not a plugin, but the best choice for generating tags.

I must say that Ctags is amazingly reliable for code navigation (which most of what I really need to be productive), but it lacks decent autocompletion. 

Adding the following to the Vim config gives some useful extra info:
```vimscript
let g:gutentags_ctags_extra_args = ['--fields=+ainKz']
```

And this will prompt you with a list of possible results when jumping to a tag that overlaps with others:
```vimscript
nmap <C-]> g<C-]>
```

# ✨Bling✨
Make it shiny! 
Finally, stuff that makes it prettier, but that doesn't add much functionality.
* [Rainbow Improved](https://github.com/luochen1990/rainbow): Color your parentheses and brackets.
* [Dev Icons](https://github.com/ryanoasis/vim-devicons): Filetype icons and more. Requires special fonts (ie [NerdFonts](https://www.nerdfonts.com/))
* [Current Word](https://github.com/dominikduda/vim_current_word) Highlights occurrences of the word under cursor.
* [Signature](https://github.com/kshenoy/vim-signature): Manages and displays (book)marks.