3

I am trying out the c.vim plugin. The plug-in works great. But I have a small problem in using Doxygen. What I would like is to generate a doxygen style comments for a function automatically ( as soon as I fill the place holders ).

But the latter is not working. It just generates the default comments.

I have set " let g:C_UseTool_doxygen = 'yes' " in my .vimrc.

According to the documentation (http://lug.fh-swf.de/vim/vim-c/csupport.html#csupport-doxygen), I should open the Templates file (https://github.com/vim-scripts/c.vim/blob/master/c-support/templates/Templates) and include 'doxygen.template'. However, I dont have that template file. So I took it from http://www.vim.org/scripts/download_script.php?src_id=21803 and placed it in the right folder. Even now it is not working.

As a side question (or a comment)... I checked the idioms file for the template of function. There the return type is hard coded as "void". Should'nt the return type be a place holder?

Can someone help me.. especially with the first question...

knightrider
  • 2,063
  • 1
  • 16
  • 29

1 Answers1

1

lh-cpp provides the :DOX command for this purpose. It processes the return type, the parameter list, and the exception specification. C++ templates parameters are not yet detected -- I have to rewrite the parser to use clang for this purpose.

The templates can be tuned thanks to options, and even modified/overloaded.

Regarding snippet/template for a function, I really don't see the point for a snippet as what a snippet can add is the pair of curly brackets and the pair of round brackets and a few spaces. IMO, a bracketing system will be as efficient here. And yet, it could be as simple as:

<+void+> <+name+>(<+parameters+>){<+code+>}

(There are no spaces here as lh-cpp, through mu-template, uses the styling feature from lh-dev -- yeah, there are many plugins involved here -- to add the spaces and newlines where ever the project style commands to)

Luc Hermitte
  • 31,979
  • 7
  • 69
  • 83
  • Hermitee I will take a look at lh-cpp. Maybe I am wrong, but I was at least hoping that c.vim would automatically call :Dox just after place holders are completed so that I could avoid some keystrokes (to move + cmd) – knightrider Oct 02 '15 at 20:39
  • AFAIK, c.vim does not provide advanced features (in the sense that parse C++ code). Our plugins are unrelated. c.vim uses no feature from lh-cpp, nor lh-cpp uses features from c.vim. – Luc Hermitte Oct 03 '15 at 21:31