vim-python / python-syntax

Python syntax highlighting for Vim
MIT License
437 stars 83 forks source link

Render Python docstrings as comments #45

Closed viniciusban closed 2 years ago

viniciusban commented 6 years ago

Usually docstrings are used to document modules, classes, methods and functions.

So, I decide to render them as comments (italics in my vim theme).

nfnty commented 6 years ago

This will highlight all multiline strings as comments. Python function docstrings are just regular strings that are parsed differently. You'll need some clever regex to be able to tell normal strings from docstrings, which will increase load times etc. As is, this is not okay.

wmvanvliet commented 6 years ago

Seeing how docstrings take up a very large part of my screen and therefore have a huge impact on how my code looks, I would very much welcome the ability to highlight them as comments, even if that means all multiline strings would be rendered as such.

How about adding a configuration flag g:python_multiline_string_as_comment to toggle the behaviour?