Vim as Python IDE

Vim

I’m by no means a Python developer, but as a sysadmin, I’m constantly interacting with Python - my scripting language of choice. My preferred text editor is Vim, which I’ve been using for as long as I can remember.

I’ve never been a fan of bloating applications with unnecessary plugins and modules, and Vim is no exception. Over the years, I picked up just a handful of plugins that make my life easier and boost my productivity. Here’s my ideal, minimal Vim setup.

Looks department

vim-airline in combination with vim-airline-themes transforms Vim’s default tab/status line into an eye-pleasing, information-packed status line. I’m using vim-airline inspired tmux status line theme as well, which goes hand in hand with my Vim look. But I digress.

Having tried a bunch of light and dark themes, I settled with Bad Wolf color scheme a long time ago.

Productivity department

To interact with Git and Python virtualenvs, I use fugitive.vim and virtualenv.vim. Both are nicely integrated with vim-airline, so I’m able to keep track of checked out Git branch and currently loaded virtualenv at all times.

For quick finding and opening of files, I rely on ctrlp.vim. Once you get used to this wonderful, full path fuzzy file, buffer, mru, tag finder, you’ll never want to go back. This thing is irreplaceable when working with projects that contain a large number of files all scattered in subfolders.

For code completion, I use YouCompleteMe plugin, which works very well not only with Python but with many other languages as well. Besides code-completion, this plugin can display documentation for functions, classes, etc. in the preview window, which is often helpful.

For a very long time, I’ve been using syntastic syntax checking plugin, but recently I switched over to ALE, primarily because I found that it supports syntax checking in real-time (with flake8), while the file is being edited. In comparison, Syntastic would perform a syntax check on file save.

Bonus

A short video clip where most of the mentioned plugins can be seen in action.