Is there any plugin for Vim that inserts documentation template for each method when coding like docblockr in Atom? I googled it but results are irrelevant.
-
Try the "scripts" section of http://www.vim.org instead of Google. – romainl Jan 17 '16 at 22:01
-
If you find one please share it – SimonW Jan 18 '16 at 19:54
-
Any language in particular? – Luc Hermitte Jul 19 '17 at 16:50
2 Answers
There is no universal plugin for all file types, but a few plugins for specific ft:
e.g
- https://github.com/sumpygump/php-documentor-vim for
php
. - https://github.com/heavenshell/vim-jsdoc for
javascript
.
EDIT: Another way is to use snippets.
Its always a good idea to search vim plugins in github instead of vim.org.

- 11
- 2
I'm only familiar with the Sublime Text DocBlockr, but the Atom DocBlockr is a port of this so they should be functionally the same.
I've found nothing to match the power of DocBlockr after trying numerous failed attempts. I'm using GVim 8.0 on Windows.
vim-jsdoc mentioned by @MisterOccan gets close but it's only for JavaScript. You can set this to request for input (via let g:jsdoc_allow_input_prompt = 1
in your .vimrc
) which allows you to set the values in a similar way to DocBlockr.
For PHP development the best I've found is the updated PDV v2 from TobyS. This combines with the UltiSnips plugin which allows tabbing though the generated doc (via Ctrl+j / Ctrl+k). So this actually gives a relatively close approximation to DocBlockr.
However
- PDV v2 doesn't generate
@return
values I'm not sure why (just one of the many niggles I've come across) - PDV v1 (and it's clones the most recent being php-doc-modded) does generate
@return
values, but lacks the formatting and the ability to tab through the inputs - None of the PHP documentors nicely format to the same extent the types and descriptions to line up vertically as with DocBlockr
- None of them have the autocomplete for adding extra tags
- The type hinting seemed to work better in DocBlockr than and of the Vim plugins that I tried
Edit: You can actually fix the PHP doc block formatting by using the Tabular plugin, with the following command:
:Tabularize /\$\w*/l1
This will match all the $xxx
(\$\w*
) variable names for the @param
lines and pad them appropriately (using left align (l
) with one space (1
)).
Other plugins that I tried:
- Rican7/php-doc-modded: This adds a comment at the end of every function
- spf13/PIV

- 11,395
- 8
- 76
- 90