(Do)cumentation (Ge)nerator for nearly 20 languages Generate proper code documentation with a single keypress. ⚡️
(Do)cumentation (Ge)nerator for nearly 20 languages Generate proper code documentation with a single keypress. ⚡️
Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Martin Fowler, 1999
We all love documentation because it makes our codebases easier to understand, yet no one has time to write it in a good and proper way.
Vim-doge is a (Do)cumentation (Ge)nerator which will generate a proper documentation
skeleton based on certain expressions (mainly functions). Simply put your cursor
on a function, press d, jump quickly through TODO items using
and to quickly add descriptions and go on coding!
Every language that has a documentation standard should be supported by vim-doge.
Is your favorite language not supported? [Suggest a new language][suggest-language] :tada:
Is your favorite doc standard not supported? [Suggest a new doc standard][suggest-doc-standard] :tada:
| Language | Doc standards | |
|---|---|---|
| :white_check_mark: | Python | [reST][py-rest], [Numpy][py-numpy], [Google][py-google], [Sphinx][py-sphinx], [Doxygen][doxygen] |
| :white_check_mark: | PHP | [phpdoc][phpdoc] |
| :white_check_mark: | JavaScript (Vanilla, ES6, FlowJS, NodeJS, Svelte, Vue) | [JSDoc][jsdoc] |
| :white_check_mark: | TypeScript | [JSDoc][jsdoc] |
| :white_check_mark: | HTML (through inline `` tags) | [JSDoc][jsdoc] |
| :white_check_mark: | Lua | [LDoc][ldoc] |
| :white_check_mark: | Java | [JavaDoc][javadoc] |
| :white_check_mark: | Groovy | [JavaDoc][javadoc] |
| :white_check_mark: | Ruby | [YARD][yard] |
| :white_check_mark: | C++ | [Doxygen][doxygen] |
| :white_check_mark: | C | [Doxygen][doxygen], [KernelDoc][kerneldoc] |
| :white_check_mark: | C# | [XMLDoc][xmldoc] |
| :white_check_mark: | Bash | [Google][sh-google] |
| :white_check_mark: | Rust | [RustDoc][rustdoc] |
| :white_check_mark: | R | [Roxygen2][roxygen2] |
| :white_check_mark: | Scala | [ScalaDoc][scaladoc] |
Using plug:
Plug 'kkoomen/vim-doge', { 'do': { -> doge#install() } }Using vim-pack:
git clone --recursive --depth 1 https://github.com/kkoomen/vim-doge ~/.vim/pack/*/start/vim-doge:call doge#install()Using Pathogen:
git clone --recursive --depth 1 https://github.com/kkoomen/vim-doge ~/.vim/bundle/vim-doge:call doge#install()Using Vundle:
Plugin 'kkoomen/vim-doge':call doge#install()Using packer.nvim:
use {
'kkoomen/vim-doge',
run = ':call doge#install()'
}Using LazyVim:
{
"kkoomen/vim-doge",
}:call doge#install()Run :help doge to get the full help page.
Vim-doge supports multiple doc standard and you can overwrite them per filetype in your vimrc. Is your favorite doc standard not supported? [Suggest a new doc standard][suggest-doc-standard] :tada:
Example:
let g:doge_doc_standard_python = 'numpy'If you want to change the doc standard specifically for a buffer, then you can do:
" Inside test.py
:let b:doge_doc_standard = 'numpy'If you want to generate a docblock using a different doc standard just for a
specific expression, then you can use the DogeGenerate command:
" Inside test.py, cursor is at a function expression (cursor = `|`):
" |def foo(p1, p2):
" pass
:DogeGenerate numpyHere is the full list of available doc standards per filetype:
:warning: For C and C++, see C Family Doc Standard Examples.
| Variable | Default | Supported |
|---|---|---|
g:doge_doc_standard_python |
'reST' |
'reST', 'numpy', 'google', 'sphinx', 'doxygen' |
g:doge_doc_standard_php |
'phpdoc' |
'phpdoc' |
g:doge_doc_standard_javascript |
'jsdoc' |
'jsdoc' |
g:doge_doc_standard_html |
'jsdoc' |
'jsdoc' |
g:doge_doc_standard_lua |
'ldoc' |
'ldoc' |
g:doge_doc_standard_java |
'javadoc' |
'javadoc' |
g:doge_doc_standard_groovy |
'javadoc' |
'javadoc' |
g:doge_doc_standard_ruby |
'YARD' |
'YARD' |
g:doge_doc_standard_cpp |
'doxygen_javadoc' |
'doxygen_javadoc', 'doxygen_javadoc_no_asterisk', 'doxygen_javadoc_banner', 'doxygen_qt', 'doxygen_qt_no_asterisk', 'doxygen_cpp_comment_slash', 'doxygen_cpp_comment_exclamation', 'doxygen_cpp_comment_slash_banner' |
g:doge_doc_standard_c |
'doxygen_javadoc' |
'kernel_doc', 'doxygen_javadoc', 'doxygen_javadoc_no_asterisk', 'doxygen_javadoc_banner', 'doxygen_qt', 'doxygen_qt_no_asterisk', 'doxygen_cpp_comment_slash', 'doxygen_cpp_comment_exclamation', 'doxygen_cpp_comment_slash_banner' |
g:doge_doc_standard_sh |
'google' |
'google' |
g:doge_doc_standard_rs |
'rustdoc' |
'rustdoc' |
g:doge_doc_standard_cs |
'xmldoc' |
'xmldoc' |
No open issues yet, or sync has not completed.