I just discovered the crazy awesome Vim plugin OnSyntaxChange. My first usage attempt is to enable text wrapping when editing Python comments and multi-line strings.
The first part was easy, as it's basically one of the documented examples:
autocmd Filetype python call OnSyntaxChange#Install('Comment', '^Comment$', 1, 'i')
autocmd Filetype python autocmd User SyntaxCommentEnterI setlocal textwidth=80
autocmd Filetype python autocmd User SyntaxCommentLeaveI setlocal textwidth=0
However, it doesn't seem like the built-in Python syntax file makes any distinction between multi-line and single-line Python comments.
I used SyntaxAttr.vim (props to Ingo, he made both these plugins) to check the syntax group of strings in Python, and they all show:
group: pythonString->String
How do I solve this? Is there an alternative syntax file I can use? Or could I solve this with a minor modification to the built-in one?