I currently use vim and tmux to edit my code. During debugging, I often have to:
- Save my changes in vim
- Head over to the terminal pane
- Run
python -i script.py
- Do some testing (e.g. print some variables, check out error messages, etc), then head back to my vim pane.
However this becomes cumbersome when after several edits, as every time, I would switch over to the terminal pane, quit the python -i session, and rerun python. Worst of all, I lose all my python history when I restart the session!
I thought of binding something like :!python -i <current file>
in my .vimrc, but that would not solve the problem as I can't edit the script while testing it at the same time (as one would do with an IDE, and also the reason I got tmux). Running python -i
seems to crash vim anyway.
What should I do?