Over the years I’ve jumped back and forth between many code editors, IDEs and tools; but it seems that somehow I always end up coming right back to VIM, and not only for programming — guess which markdown editor I’m using to write this post.
I’ve have tried Atom, SublimeText, TextMate, Eclipse, Visual Studio, and most of the Jetbrains products, I’m constantly tweaking and looking for a better setup, however Vim always feels like home to me; and I’m to the point now where I rarely use IDEs — exception being messy and complex projects where IDEs can do a lot of heavily lifting (yes, Magento I’m talking about you.)
But other than that Vim is my default Ruby, Elixir, Python, PHP IDE and as well the main tool that I use for writing drafts and books.
So how does this magical tool work? Is all out of the box right? right? Well no, as with all the worthwhile things in life there is a bit of effort involved on getting the Vim setup just like I wanted it. Fortunately, is far from custom and is mostly the right combination of plugins.
You can find my current Vim configuration and dot files in its corresponding Github repository feel free to fork it and give a shot.
We are in particular interested in the vimrc file, let’s break it down:
Each plugin in this setup is separated in the following categories:
This kind of a miscellaneous category and is comprised of plugins used to enhance or change the behaivour of core vim; the most useful important ones are:
These plugins fall directly on the category of programming and are used my all or most of the programming languages that I currently have setup:
As I mentioned Vim is my go to editor for drafting new posts be it books, blogs or random angry letters. From this particular section only language tools deservers a special shot-out as it makes for a great Grammar checker directly from inside Vim.
When it comes down to the individual language support there isn’t really much to highlight other than I’ve tried (and somewhat failed) to keep the plugins to a minimum and focus only on the essential language support.
So far elixir is winning the battle in terms of plugins as I’ve added additional functionality like the ability to run tests and generate content from inside Vim, I have yet to decide if I’m keeping all the plugins for it.
Standard git support that I’m afraid I rarely use, I find myself going directly back to the shell and doing the git workflow outside of Vim, so I’m open to suggestions and to hear what everyone else is using in terms of setup.
Ok this is a big one but mostly because I keep forgetting to remove unused themes and colorschemes, let’s highlight the important ones:
The remaining parts of the configuration file are either plugin configuration or personal key re-mappings that I use for quality of like; I’ve done my best to document and segment each section so it should be easy enough to understand what each setting is doing.
For anyone getting starting with Vim, I do want to bring special attention to the following:
" Disable arrow movement, resize splits instead.if get(g:, 'elite_mode') nnoremap <Up> :resize +2<CR> nnoremap <Down> :resize -2<CR> nnoremap <Left> :vertical resize +2<CR> nnoremap <Right> :vertical resize -2<CR>endif
As there is no quickest way to force one-self to use the home row for navigation.
I hope that for some of you this post has been helpful for some, and I’m far from done with my current setup, in that sense this is very much a toy that I continue playing on a nearly daily basis; now that being said and in order to get back to the original premise of the post; it is indeed a very powerful toy, specially when combined with other tools like Tmux, here is a sneak peak of my Elixir ‘IDE’ powered by Vim and Tmux:
VIM + TMUX = Super IDE
If you want to know more about my setup, or want to share yours please leave a comment below.
This article was originally posted on my own site.