3

Since I am using Sphinx with autodoc I would like to have my vim highlight python docstrings with ReST syntax. Is that possible?

Searching with google yielded only one usable result (I was surprised not to find more though):
http://www.liafa.univ-paris-diderot.fr/~labbe/blogue/2011/06/rest-syntax-highlighting-for-sage-docstrings-in-vim/
But this solution seems to have some circular dependency which causes my vim to complain with infinite error messages... dunno how to solve that :/

On Stackoverflow I found this one: Vim syntax highlighting of doxygen style docstrings in Python
But I have no idea how to adapt that either.

Any suggestions?
Thanks in advance :)

4
  • 1
    Finally I found the plugin riv.vim with let g:riv_python_rst_hl=1 it does what I want. Commented Jun 29, 2014 at 13:55
  • You should post that comment as an answer Commented Jan 27, 2015 at 0:53
  • I tried, answers which are too short are automatically transformed to comments... Commented Jan 27, 2015 at 12:58
  • Fill it out a bit? describe what riv.vim is, and what that options does, and what flaws it has... Commented Jan 27, 2015 at 13:07

1 Answer 1

0

As mentioned in the comments, there is a vim plugin riv.vim that provides lots of tools for interacting with reST documents. If you do:

let g:riv_python_rst_hl=1

It will enable proper reST syntax hilighting for docstrings in python files.

Sign up to request clarification or add additional context in comments.

1 Comment

This plugin doesn't work for me. The docstrings in my python files are unchanged.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.