-
-
Notifications
You must be signed in to change notification settings - Fork 486
Support for additional filetypes
jsctags has much better support for JavaScript than standard Exuberant Ctags and is itself written in JavaScript. Tagbar already includes support for jsctags, so if your jsctags
executable is in your $PATH
it should just work. If it is not in your $PATH
you have to copy this into your ~/.vimrc
and adjust the path accordingly:
let g:tagbar_type_javascript = {
\ 'ctagsbin' : '/path/to/jsctags'
\ }
Note that currently there is a bug in jsctags that will cause all tags to be reported as top-level tags instead of in their proper scopes (see here for progress on the bug: https://github.com/mozilla/doctorjs/issues/5).
In order to get proper support for scopes you can check out an older, working version by doing this in a git clone of jsctags:
git checkout 1062dd31625cc002261f15e68af77eedd63a56f6
sudo make install
CoffeeScript support is provided by CoffeeTags. That page explains everything about how to set up CoffeeTags with Tagbar.
Similarly, Haskell support is provided by lushtags.
An example configuration for Scala, which requires adding a ctags regexp configuration, is described here. Note that instead of putting the Tagbar configuration directly into one of Tagbar's files as the post suggests put this into your ~/.vimrc
:
let g:tagbar_type_scala = {
\ 'ctagstype' : 'Scala',
\ 'kinds' : [
\ 'p:packages:1',
\ 'V:values',
\ 'v:variables',
\ 'T:types',
\ 't:traits',
\ 'o:objects',
\ 'a:aclasses',
\ 'c:classes',
\ 'r:cclasses',
\ 'm:methods'
\ ]
\ }