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:
- Tim Pope’s vim-dispatch plugin –
allows you to dispatch the
rails consolecommand to a tmux split
- Chris Toomey’s vim-tmux-navigator plugin – used to jump back and forth between vim and tmux
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.
You can also set up a quick leader key to boot:
nnoremap <leader>rc :Dispatch rails console<cr>