Editor with Python backend

Charles Boncelet boncelet at udel.edu
Wed Mar 22 17:58:06 EST 2000


Johann Hibschman wrote:

> Charles Boncelet writes:
>
> > I use vim and have read these man pages, but I still haven't
> > figured out why? What would I use python for from within vim?
> > How do you use python within vim (or any other editor)?
>
> (stuff deleted)
>
> Here's an example.  Say I have a file with ^M's and spurious spaces at
> the end of the lines.  I can type in the interpreter window:
>
> for line in buffer["filename"].modifiable_line_iter():
>   line.set(string.rstrip(line.get())+"\n")

I know you are just giving an example of what you want to do,
but deleting ^M's is more easily done with vim commands
:%s/^M$//

My point is that vim is a pretty powerful editor and for routine
editing tasks I see no need for python.  I suppose for tricky
editing that one has to do repeatedly, having python around
might be a good thing.

Some things I'd like to see:
1. Being able to execute the highlighted line or lines.  This would
greatly
enhance vim as a python development environment.  (If this can
be done now, I'd appreciate a quick pointer.)

2. An outline mode for vim.  Maybe one can be written in python.

3. Python would really be useful if it ran in the background,
automatically interpreting editing events.

    Charlie Boncelet
------
Charles Boncelet, University of Delaware,
On sabbatical at ADFA, Canberra Australia,
Home Page: http://www.ece.udel.edu/~boncelet/





More information about the Python-list mailing list