Skip to content

Cyperwu/vim-jsdoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsdoc.vim

Build Status

jsdoc.vim generates JSDoc block comments based on a function signature.

jsdoc.vim

Note

Since version 2.0.0 jsdoc.vim is support only Vim8.

If you want use old version checkout 1.0.0.

Install

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.

Usage

  1. Move cursor on function keyword line
  2. Type :JsDoc to insert JSDoc
  3. Insert JSDoc above the function keyword line

Format

  1. Type :JsDocFormat
  2. Insert JSDoc above the all signatures

Configuration

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.

Formatter

You can choose formatter from JsDoc, ESDoc, TSDoc.

If you want to create your own template, see example template.

Intaractive input

Since ver 2.0.0 input Allow prompt for interactive input is deprecated.

If you want input Intaractively, use snippet plugin.

See snippet example template.

Keymap

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)

Thanks

LICENSE

New BSD LICENSE

About

Generate JSDoc to your JavaScript code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 90.2%
  • Shell 8.6%
  • Makefile 1.2%