jsdoc.vim generates JSDoc block comments based on a function signature.
Since version 2.0.0 jsdoc.vim is support only Vim8.
If you want use old version checkout 1.0.0.
Since version 2.0.0, jsdoc.vim requires lehre.
You can install following command.
make install
If you want to update lehre
hit following commands.
make clean
make Install
If you want install lehre manually, you can install from npm.
$ yarn add -D lehre
Than set installed /path/to/node_modules/.bin/lehre
path to g:jsdoc_lehre_path
.
- Move cursor on
function
keyword line - Type
:JsDoc
to insert JSDoc - Insert JSDoc above the
function
keyword line
- Type
:JsDocFormat
- Insert JSDoc above the all signatures
Option | Default | Description |
---|---|---|
g:jsdoc_templates_path | '' | Path to custom template. |
g:jsdoc_formatter | 'jsdoc' | Document block formatter, jsdoc , esdoc , tsdoc |
g:jsdoc_lehre_path | './lib/lehre' | Path to lehre . |
You can choose formatter from JsDoc, ESDoc, TSDoc.
If you want to create your own template, see example template.
Since ver 2.0.0 input Allow prompt for interactive input
is deprecated.
If you want input Intaractively, use snippet plugin.
You can add following setting to .vimrc
nmap <silent> <C-l> <Plug>(jsdoc)
Alternatively, you could add the following setting to your .vimrc to search for the last function
declaration
and puts your jsdoc above it:
nmap <silent> <C-l> ?function<cr>:noh<cr><Plug>(jsdoc)
-
This plugin based on https://gist.github.com/3903772#file-jsdoc-vim written by NAKAMURA, Hisashi
-
The idea of npm packages installation is from vim-lsp-settings. Highly applicate @mattn and all vim-lsp-settings contributors.
New BSD LICENSE