This would make my workflow immensely easier -- I have some simple maps for executing python .py files, and sometimes it would be nice to open an interactive session after running them (for example, an IPython shell using :!ipython -i %).

Right now, if I want to run an interactive session, I am trapped there (as this is a process that has not "finished") until I close the session and see the press Enter to continue message. But I was wondering if there was a way to switch back and forth between files open in Vim and this active process.

  • There exist a few plugins that seem to do that for us. Search for "vim + REPL". Other people may guide you toward more specific solutions. – Luc Hermitte Feb 28 '17 at 15:13

You can do that and so much more with tmux

vim + tmux - OMG!Code - YouTube

vim + tmux: A Perfect Match

tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

You can for example, split your screen, run your session and switch back whenever you like.

For better navigation also install https://github.com/christoomey/vim-tmux-navigator

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.