A Python color syntax file for VIM

Alan Daniels daniels at mindspring.com
Sat Oct 2 15:15:16 EDT 1999


An invitation to everybody:

My favorite text editor is VIM (the One True Editor), and I've always
noticed that the default syntax highlighting for Python is sort of
Spartan, in that it colors strings and keywords, and thats about it.
So, I've cooked up a new one with a few more features:

- Highlights the builtin Exceptions and functions.
- Highlights the prefab class methods(__init__, __del__, etc).
- Shows 'self' as a keyword, since so many people use it that way.
- Shows the escapes in non-raw strings ("\142", "\r", "\n", etc).
- Shows the various number types (ints, floats, exp).
- Flags constructs that Perl or C programmers might use when
  forgetting they're in Python, such as ++.

This is just a test of better syntax highlighting, and I haven't yet
talked to the existing maintainer, so I wanted to invite fellow
VIM/Python users to try it out and suggest any improvements or
additons. For example, I'm thinking of making it version-aware so that
'buffer' is a built-in function in Python 1.52, but not 1.51.

Its available at:
	www.mindspring.com/~daniels/vim/python.vim

Let me know what you think. Thanks.

-- 
=======================
Alan Daniels
daniels at mindspring.com
daniels at cc.gatech.edu




More information about the Python-list mailing list