Vim syntax highlighting of doxygen style docstrings in Python -


i started working doxygen generate documentation of python code. use doxypy filter preprocess python docstrings. goal have nice syntax highlighting of doxygen comments in python.

when writing mainpage in dedicated .dox file, found doxygen comments can highlighted in vim following command:

set syntax=c.doxygen 

i tried same command python got nothing: set syntax=python.doxygen

i made googling , couldn't find interesting

here typical piece of code i'd highlight:

class compilationtab:     """     compilation tab of verif gui. contains layout description     , functions required deal specific behaviors of tab     """     def __init__(self, notebook, tab_name):         """         class constructor.          @param notebook notebook: parent @c notebook widget         @param tab_name string: display name of tab         """ 

does fixed issue? thank help!

if syntax/doxygen.vim can read in preamble of file only

cpp, c, idl, doxygen , php 

files supported.

since doxygen.vim works lot syn region command searched line defines multiline string in syntax/python.vim.

the interesting part of command defines region is

syn region pythonstring start=+[uu]\=\z('''\|"""\)+ end="\z1" keepend 

derived in doxygen.vim , above line can add following lines

"delete following line if don't want have enhanced colors let g:doxygen_enhanced_color=1 runtime! syntax/doxygen.vim syn region doxygencomment matchgroup=pythonstring start=+[uu]\=\z('''\|"""\)+ end="\z1" contains=doxygensyncstart,doxygenstart,doxygentodo keepend fold containedin=pythonstring 

to ~/.vim/after/syntax/python.vim or execute them hand.

in addition may have customize colors of added doxygen highlighting groups hand. @ least since resulting doesn't conform taste.

perhaps fold argument of syn command of special interest you. if set foldmethod syntax can fold , unfold multiline comments. seems useful if no longer stand view of colors , lazy adjust them :)


without doxygen highlighting:

enter image description here

with doxygen highlighting , g:doxygen_enhanced_color == 1:

enter image description here


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -