sponsor Vim development Vim logo Vim Book Ad

DoxyGen Syntax : DoxyGen Highlighting on top of c/c++/java

 script karma  Rating 242/103, Downloaded by 14048  Comments, bugs, improvements  Vim wiki

created by
Michael Geddes
script type
This Script has been moved into Vim7.

:set syntax=cpp.doxygen

Provides DoxyGen Highlighting on top of c/c++/idl/java.  DoxyGen is close to JavaDoc that it should be fine for JavaDoc as well.  It supports most of the keywords in DoxyGen in one way or another.

There may be some problems where doxygen tags need to be included in exclusion groups of the c/c++/java/idl files.

At the moment, it uses non-conventional colours, which I think is good, as it differentiates it from the source-code.  Please let me know if your opinion differs, especially if you have a set of standard defaults that would be appropriate.
install details
Needs to be sourced after the language files.
To detect *.doxygen files as being doxygen, make the file
---------8<----------- .vim\ftdetect\doxygen.vim -----------
  au BufNewFile,BufRead *.doxygen setfiletype doxygen
There are a few ways to add doxygen syntax hilighting to c,cpp,idl files,
1: create files .vim/syntax/c.vim  .vim/syntax/cpp.vim .vim/syntax/ which
load the original syntax before loading doxygen.vim syntax hilighting.
2: Before :syntax on in your _vimrc, put
let mysyntaxfile='<some_path>/doxygen_load.vim'
and then create the following file.
-----------8<--------- <some_path>/doxygen_load.vim --------
au! Syntax {cpp,c,idl}
au Syntax {cpp,c,idl} runtime syntax/doxygen.vim

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
doxygen.zip 1.15 2005-12-12 6.0 Michael Geddes 1.  Words like `Class#Member' is highlighted together as a link in my
2.  I used `doxygenHyperLink' instead of `doxygenHttpLink' and
    highlighted http, https, and ftp protocols.
3.  I added the missing `doxygenSpecialArgumentWord' to make `\a' (not
    the word after) appear the same way as `\c'.
4.  I made some adjustments in font choosing on non-Windows platforms.
5.  The `Last Change' date is not updated in your file.
6.  There are some trailing spaces in your file.
doxygen.zip 1.14 2005-10-27 6.0 Michael Geddes Fixed up  \c words ending in )  (Wu Yongwei)
- With auto-brief //!< followed by /** shouldn't supress the auto-brief in   the /**. (Reported by Markus Trenkwalder)
- Allow numbers in @link linkwords (Reporeted by Wu Yongwei)
- Don't treat # preceded by a word-end as a Hash-special (Reported by Wu Yongwei)
- include # (@c #include) in the small-specials allowed chars. (Wu  Yongwei)
- Highlight http[s] links (Wu Yongwei)
- Various (Wu Yongwei)
doxygen.zip 1.12 2005-01-27 6.0 Michael Geddes - Fixed up ending of brief lines with respect to line @ commands and  end-comment. Not ending a brief no longer produces an error-comment.

doxygen.zip 1.11 2005-01-25 6.0 Michael Geddes    - Allow doxygen comments inside brackets (Suggested by Zygmunt Krynicki)
   - Restore correct font selection (Wu Yongwei)
   - Don't end brief when encountering ? or ! as this isn't what happens with doxygen.
   - Make punctuation an option.
   - Make short words end with a , eg \c word,  (Wu Yongwei)
   - Thanks to Joseph Barker for pointing out that I had a syntax error in  1.10
doxygen.zip 1.9 2005-01-07 6.0 Michael Geddes Thanks to Toby Allsopp for this version:
- Allow javadoc style auto-brief to be disabled
- Move various definitions from single to multiline definitions
Also added the .txt help file.
doxygen.vim 1.8 2004-12-10 6.0 Michael Geddes - Fix up some regions not marked as contained (code, verbatim, dot being
highlighted outside of the doxygen region) (Toby Allsopp)
- Only mark recognised HTML tags (Suggested by Mike Anderson)
doxygen.vim 1.7 2004-08-15 6.0 Michael Geddes   - Ignore Errors when loading from idl.
  - Try and match # and \c &c support to match what really happens. (Reported by Wu Yongwei)
  - Don't go into doxygen mode for /**/
  - Fix up syncing of brief after a \def or similar line - character
    immediately following a leading asterisk were being hilighted long.
  - Try and work out a better default font for \c
  - add support for \code \endcode \verbatim \endverbatim (no contained elements) (suggested Yongwei)
  - add contained support for dot (\dot \enddot)
  - support html <!-- --> comments.
  - support for params inside \c \ref brackets (can contain spaces?).
  - highlight closing */ as error when found inside \code, \verbatim sections as well as \c, \ref sections with
    unmatched brackets.
doxygen.vim 1.6 2004-08-10 6.0 Michael Geddes - Fix up # support.
- Highlight \\endlink properly.
- Don't mark */ as an error where there is no brief, or @{ is used.
doxygen.vim 1.5 2004-08-06 6.0 Michael Geddes - Make sure @c \c and friends are equivalent for the start of a brief section.
- Allow @c \c and friends to cross lines. (Caveat, they can't be hard up  against a continuation '*' - it just gets tooo difficult).
- Highlight a missing \endlink as an error.
- Fix multiline description without a '*'
doxygen.vim 1.4 2004-08-02 6.0 Michael Geddes - Patches from Wu Yongwei
  * Include '-' in inline \c \e maching.
  * \see, \return are multiline desc.
  * \throw can now handle std::alloc (colons were confusing it)
- Fixed support for <a href=> links.
- Reported by Wu Yongwei
  * Handle [in,out] in \param.
  * Handle non-terminating . in a brief description (eg A.B)
  * allow leading asterix inside HTML marks.
  * Fix up <a> link hilighting when interupted by new-lines and comment
  * Handle the case where \c \ref etc are used at the beginning of a 'brief'
- Fixed termination of multiline at start of new command.
- Include John McGehee's instructions.
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Vim at Github