[Tutor] Block highlighters in python

Alan Gauld alan.gauld at btinternet.com
Tue Apr 8 10:47:36 CEST 2014

On 08/04/14 06:48, Santosh Kumar wrote:
> Is there a way by which we can highlight a block in the python ?
> i have a huge code and i want to see a block of ``if`` code. How do i
> achieve this in VIM or any other editor.
> Note: In perl if i put my cursor on one "{" it will hightlight the other
> closed "}".
> Do we have any such facility in python ?

This is not a feature of Python but of the IDE or editor.
I don't know of any editor that does that although several
have folding that can collapse a block (one example is Scite)
so it should be possible.

Some of the Python specific IDEs or the Python plugins for
Netbeans or Eclipse etc might support it.

In vim, if you put blank lines between your blocks the {}
keys will move yo to beginning/end of block (ie paragraph).
That's how I tend to do it... But that doesn't match where
you have nested blocks, inside a function say and you want
the outer block...

Alan G
Author of the Learn to Program web site

More information about the Tutor mailing list