Vim and tmux awesomeness for Rails development

01 Feb 2015

I would like to share the workflow i use for working on ruby on rails projects. So here it goes:

Tools

  1. Vim as my ‘IDE’ of choice
  2. Tmux for quick switching between different processes in the terminal and for having multiple terminal sessions open simultaneously if needed
  3. Tmuxinator for automating the process of getting everything up and running when starting work on a project daily

How it looks

Below is a screenshot of how it all looks

alt text

Now you may ask why i use vim instead of something else like sublime text or rubymine for example ?.Well, its just a matter of personal preference. I dont believe in being a zealot and saying that everyone should use vim,you should use whatever you are most comfortable with but as far as im concerned,vim gives me all the productivity that i would expect from some other tool,plus having everything inside the terminal saves me from having to switch back and forth between the GUI and the terminal.

Everything from running tests quickly,quick source code navigation,git integration,searching etc are all available. All this is possible because of the great collection of plugins available for vim. I use a package manager called Vundle which makes it really easy to use these plugins. Also, vim and tmux make the process of screen sharing and pair programming really easy which greatly facilitates working remotely.

I agree that for people not used to vim there is a steep learning curve but once you get over that, the productivity gains are immense and you have complete power to customize your development experience. Having said that if you would like to setup a rails development environment in vim, you can find a copy of my vimrc file here.

Tmuxinator is another tool worth checking out. As Rails developers,for any given project we may need to have multiple stuff running like for example the editor window,rails server, the rails console, sidekiq process, redis console,remote ssh sessions etc and having to start each of this daily is very cumbersome.Here is where tmuxinator comes in. It allows us to save the requirements for each project in a separate config file for each, so its just a matter of running a single command and everything is automagically started for us !. Sweet, isnt it ? :blush:. I would get into more detail on each of these topics in later posts but i hope that you found this overview useful.