StandardNerd StandardNerd - 2 months ago 20
Python Question

Python Interpreter Shell with Vi(m) integration possible?

I love to use bpython but in Ruby there is a gem called interactive_editor that makes it possible to combine Vi(m) with the Ruby shell which makes the Development process much more comfortable. A good introduction to interactive_editor: http://vimcasts.org/episodes/running-vim-within-irb/

Are there any tools (like interactive_editor for Ruby) available to combine the Python shell with Vi(m)?

Answer

You could have a look at the vim-ipython vim plugin:

https://github.com/ivanov/vim-ipython

This requires you to install the ipython shell (but I recommend doing this anyway as it adds a lot of functionality to the standard python shell).

If you don't want to install ipython, I suggest having a look at the ConqueShell plugin for vim:

http://www.vim.org/scripts/script.php?script_id=2771

This lets you run shells within vim. Once you've sourced the vim-ball, all you need to do is

:ConqueTerm python

to get a python shell directly in vim.