How do I mimic the behavior of Doxygen comment highlighting for PC-lint comments? Comments are in the following formats:

/*lint ... */
//lint ...
/* VARARGS[N] */ <--- N is a number
/* PRINTFLIKEN */ <--- N is a number

Ideally highlighting would mimic the behavior of Doxygen comment highlighting.

EDIT: I want to make lint comments highlight like the Doxygen comment in the screenshot. like this

  • Do you want the above to be simply highlighted as comments or is there additional nested highlighting that you want? If it's the latter, a screen-shot might help.
    – Tumbler41
    Apr 13 '17 at 14:39
  • @Tumbler41 I want to highlight the listed keywords in the comments just like Doxygen commands are highlighted.
    – thetic
    Apr 13 '17 at 15:09
  • Maybe I'm in the minority, but I don't know how Doxygen commands are highlighted, and a quick google search produced nothing useful. Could you provide a screenshot with the appropriate highlighting you're looking for?
    – Tumbler41
    Apr 13 '17 at 15:18

Did you have a look at syntax/doxygen.vim? This is where doxygen highlighting is defined.

What you need to do then, is to add a file for pclint in ~/.vim/syntax/, and a syntax rule inspired from the one in syntax/synload.vim which is:

au Syntax c,cpp,cs,idl,java,php,datascript
    \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
    \   || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
    \   | runtime! syntax/doxygen.vim
    \ | endif

See :h mysyntaxfile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.