Vim Plugins that Cure Depression ๐
I didn't think life (in a terminal editor) could get so good.
There's nothing more fulfilling than seamless text editing, but some features are beyond vanilla Vim. I've collated some extensions that range from nifty to aphrodisiacal.
I use Neovim but need a backward compatible config, so all of these work well in Vim.
- COC - autocomplete, jump to definition and refactor
- FZF - fuzzy project file search
- Commentary - block commenting
- Surround - changing and inserting bracket/quote mark/tag pairs
- Highlighted Yank
- REST Console - perform HTTP requests
- Vimium - vim bindings in a browser
COC
Newer plugins work better and are less bloated, but I love Coc. It's simple to set up and comes with everything out of the box. Decent autocomplete, fast jumping to function definitions and references and clean refactoring.
Ensure you add the languages you use to vimrc.
let g:coc_global_extensions = [
\ 'coc-snippets',
\ 'coc-pyright',
\ 'coc-clangd',
\ 'coc-sh',
\ 'coc-vimtex',
\ 'coc-docker',
\ 'coc-json',
\ 'coc-yaml',
\ 'coc-html',
\ 'coc-css',
\ 'coc-tsserver',
\ 'coc-flutter',
\]
FZF
Essential for larger projects where you can't remember exact functions, variables or file names. FZF is a general-purpose fuzzy finder ported to Vim as a robust project file search.
Knowing what's going on in a command line editor is more of a challenge than using one. This plugin takes orienting yourself and jumping around to a new level.
Commentary
Not the most glamorous plugin, but its absence is excruciating. It is a crime that Vim doesn't come with block commenting, so this avoids having to visual block insert comment characters - then visual block remove them when you've fixed your mess.
Surround
Simultaneous bounding character operations. Insert, change and remove pairs of brackets, quote marks, HTML tags, or anything really.
Highlighted Yank
A quality of life plugin that solves the awkward 'wait, what did I just yank' pause.
REST Console
A great alternative to Postman. List out API requests between three hashes as below, and C-j to send manual HTTP requests.
It's not as good as scripting (you'll need to copy-paste keys and whatnot each request), but a helpful prototyping tool nonetheless.
Vimium
Not a plugin per se. It's a free browser extension that enables vim key bindings.
Press f to identify interactive DOM elements and then corresponding location letters. It makes for smooth switching between editor and browser interaction and a substantial engineer ego boost using the mouse less.
Some version is available from your browser's extension store.
I'd share my full config, but I accidentally git-pushed a password at some point. Repo is private at the mo ๐