Rails Console Without Leaving Vim

January 11, 2017

Some time ago, I grew weary of being forced to exit vim when needing to poke around in the rails console. Thanks to the following vim plugins (and tmux) this problem was duck soup:

With these plugins installed, one can simply run :Dispatch rails console to open the rails console beneath vim in a tmux split.

Note: If you are not in a tmux session while running this command it will hide vim and display the rails console as if you ran a bang command, i.e. !rails console.

vim-dispatch rails console in tmux

You can also set up a quick leader key to boot:

nnoremap <leader>rc :Dispatch rails console<cr>