Here's a quick syntax file to support Python docstrings: highlighted
them comments, rather than as strings.  Put this in ~/.vim/syntax or
equivalent.  I think this should be the default behavior; it makes
docstrings much more comfortable to use.  They're much closer to
comments than strings.

This is a hack.  It duplicates pythonString, because I'm not sure how
to reuse it.  It doesn't highlight docstrings declared as raw strings
because I didn't want to duplicate pythonRawString and I can't think
of why anyone would do that, but it's legal.  It should only trigger
after a block that declares a function or class, but it will treat
strings at the first line of any block as a docstring (maybe this is
okay, even though it's not a real docstring).

I made an abortive pass at trying to support doctests.  Maybe someone
more familiar with the syntax highlighting will feel like doing
that...

-- 
Glenn Maynard

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Attachment: python.vim
Description: Binary data

Reply via email to