Good Editor? (What's the big deal with syntax colouring?)

rainy sill at localhost.kitenet.net
Sun Apr 8 06:17:19 EDT 2001


On Tue, 27 Mar 2001 16:44:29 -0500, D-Man <dsh8290 at rit.edu> wrote:
>On Thu, Mar 22, 2001 at 10:38:00PM -0800, Nathaniel Gray wrote:
>| Timothy Grant wrote:
>| > Now if only else didn't highlight but else: did<wink>
>
>$ vim $VIM/syntax/python.vim   
>
>;-)  you can adjust the regexes to your preferences
>
>| Ah, but that's what auto-indent is for!  When NEdit doesn't indent the 
>| first line of a block I know I forgot the colon at the end of the last line.
>| 
>| One of these days I'll send in my ultra-improved auto-indent Python macros 
>| for NEdit.  I'm still working on the auto-dedent macros... <wink>
>
>I can't wait for auto-dedent in vim, it has most of the auto-indent
>correct.  Anyone want to work on making it?  Vim is python-scriptable
>as well.
>
>-D

I tried to script it in python so that it'd indent only when the last line
ends in a colon, but it didn't work for some reason. I even asked on relevant
newsgroup but nobody could help. So, right now I simply have a list of keywords
liek if, else, class, etc in cinw like this in my .vimrc:

set cinw=
:autocmd BufNewFile,BufRead *.py set cinw=try,if,def,except,for,while,else,
elif,class

I don't remember why, but the first line there is needed because by default
cinw has some keywords it indents on.. in *all* files! Or maybe not by
default but because of some other option i have set.. 

>
>


-- 

	Andrei



More information about the Python-list mailing list