Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Interpreter Shell with Vi(m) integration possible?

Tags:

python

vi

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)?

like image 542
StandardNerd Avatar asked Apr 23 '12 10:04

StandardNerd


People also ask

Can I use vim for Python?

Vim is quite a powerful text editor which can add performance to the already fast typed language Python. Vim can be highly customizable and efficient to use as it has the power of adding custom plugins and plugins managers, key mappings , and the most critical weapon of vim - Access to the terminal straight away.

Is a Python interpreter the same as a shell?

The shell is where you write your code directly in the CLI, whereas the interpreter is the program that will interpret your code and execute it. Therefore, the interpreter is called in the shell when you write some code, it may also be called when you execute some python code directly from a file.

What are two ways to run a program using the Python interpreter?

There are two ways to use the python interpreter: interactive mode and script mode.


1 Answers

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.

like image 156
Pascal Bugnion Avatar answered Sep 24 '22 15:09

Pascal Bugnion