My Vim Setup

For the past five years or so, I’ve been using a combination of Vim and GNU screen to serve as my command line IDE. I use relatively few plugins and try to keep my Vim environment as simple as possible. Here are the plugins in my Vim setup that I really like:

sessionman.vim

Sessionman.vim is a Vim session manager, meaning it will save your open buffers to a file for easy re-opening. It’s useful in cases when you’ve been working on a ticket and you need to have one set of files open and then need to switch to another ticket that requires another set of files to be open. Saving your sessions is as easy as :SessionSave SessionName you can see a list of your open sessions with :SessionList. It’s very handy.

NERDTree

NERDTree is the classic Vim file explorer. When working on a new project, this plugin is invaluable for seeing what’s actually in all the directories of the project in a tree-type view. I keep this line:

autocmd VimEnter * if !argc() | NERDTree | endif

in my .vimrc to automatically open NERDTree to my current directory if I run Vim from the command line without any arguments.

LycosaExplorer

In a similar navigating-the-filesystem vein as NERDTree, I use LycosaExplorer to search the filesystem and explore my open buffers. It’s a python port of LustyExplorer and the commands are virtually the same. (Protip, the default Vim command key is \).

Flow Typechecker

Even though JavaScript is a dynamically-typed language, Facebook has developed a typechecker called Flow. I find writing typed code forces me to think more about how my application works since I have to figure out the inputs and outputs of my functions before I write them. I use the vim-flow plugin to keep my types in line and catch bugs before they happen.

Fugitive

Often times I’m browsing a project and find a line of code that puzzles me and I want to see who wrote it and why. With Fugitive, I can call :GitBlame and shame! It’s a seriously helpful tool if you’ve inherited a project and want to match architectural decisions back to commits back to tickets.

REST-Console

vim-rest-console is somewhat handy for doing simple work with REST apis. Simply open a new buffer and set the filetype to REST :set ft=rest, specify a host, and send your POST, GETs, PUTs, and DELETEs. However, I’ve found it’s difficult to work with large chunks of JSON (such as those required by the Elasticsearch DSL) and it’s easier to manipulate those with a python script.

That’s my Vim setup! Let me know if I’m missing anything in the comments.

We're building an AI-powered Product Operations Cloud, leveraging AI in almost every aspect of the software delivery lifecycle. Want to test drive it with us? Join the ProdOps party at ProdOps.ai.