Interactive Python programming in ... vi [was: Tab wars revisited]

Mark 'Kamikaze' Hughes kamikaze at kuoi.asui.uidaho.edu
Mon Jul 12 17:50:34 EDT 2004


Jacek Generowicz <jacek.generowicz at cern.ch>
wrote on 12 Jul 2004 16:57:40 +0200:
> Chris Share <usenet at caesium.me.uk> writes:
>> On Wed, 07 Jul 2004 18:36:05 -0400, Peter Hansen <peter at engcorp.com> wrote:
>> > I'm actually pretty inept with vi (or vim), to the point that I don't
>> > actually know how to configure it for use with Python.
>> FYI, it's pretty simple...
>> I use vim for writing python in, with the following options:
>> :set et
>> :set tabstop=4
> And how do I get it to send the function definition surrounding the
> cursor to the Python interpreter with which it is currently
> interacting ?
> (Only half joking ... if there is a way to make vi(m) provide the same
> interactive capabilities that Emacs does, then I would be able to
> recommend it to those who insist on using vi in my courses and end up
> trailing the rest of the class and slowing us all down.)

  Simple way: Select the block of code you want to execute with V and
motion keys, then !python^M

  Complex way: :help python, and read.

  Vim's considerably faster to work with than emacs (and easier on the
carpal tunnel than escape-meta-alt-control-shift), and Python's
completely hooked in, at least if Vim was compiled that way.  You're
just not familiar with it yet.

-- 
 <a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"The void breathed hard on my heart, turning its illusions to ice, shattering
 them.  Was reborn, then, free to scrawl own design on this morally blank
 world.  Was Rorschach." --Alan Moore, _Watchmen #6_, "The Abyss Gazes Also"



More information about the Python-list mailing list