vim-python / python-syntax

Python syntax highlighting for Vim
MIT License
438 stars 84 forks source link

Add option to highlight docstrings using rst syntax #28

Open anntzer opened 7 years ago

anntzer commented 7 years ago

vim's rst syntax (maintained upstream at https://github.com/marshallward/vim-restructuredtext) is able to highlight embedded code fragments with their respective syntax files (basically starting at https://github.com/marshallward/vim-restructuredtext/blob/master/syntax/rst.vim#L153). It would be nice if python-syntax likewise provided an option to highlight docstrings using rst syntax (I believe this kind of behavior belongs to the wrapper syntax file (in this case python.vim) and not the wrappee (rst.vim), as the wrapper should be able to just say "use some other syntax file HERE" whereas the wrappee would have to guess what syntax element of the wrapper needs to be modified).