ANN: Dao Language v.0.9.6-beta is release!

Alex Martelli aleax at mail.comcast.net
Wed Dec 7 10:58:14 EST 2005


Zeljko Vrba <mo.dor at fly.srk.fer.hr> wrote:

> On 2005-12-07, Antoon Pardon <apardon at forel.vub.ac.be> wrote:
> >
> > What I don't understand is, that most people who have a problem
> > with scope by indentation, want to introduce braces. I think
> > braces are the worst solution.
> >
> Braces are very convenient to match block start and end. Open a C program
> in the VI editor, and press % in command mode on some brace.. It will take
> you to its matching brace. How do you do something like that with python code
> (or any code that is based purely on indentation..)

By programming % to match indentation (in Python syntax mode) when the
character under the cursor when % is hit is not a parenthesis, of
course; much the same approach as you use to have it jump between
opening and closing tags when you're editing an XML or HTML file, except
that matching indentation may be somewhat easier.  You can find many vim
programming tips at www.vim.org much more easily than in this group (you
CAN program vim with Python if you wish, rather than having to use vim's
own scripting language, but for that you need to build VIM with Python
scripting enabled in the first place).


Alex



More information about the Python-list mailing list