A simple tool for generating CoffeeScript tags (Ctags compatible).
Showing only functions (right) or with variables included (left)
<img src="http://img.skitch.com/20111012-8cjesum8ru8usqusra4yppj5cc.preview.png" alt="1. CoffeeTags:1:vim - "unicorn.local" (tmux)" />
Uploaded with Skitch!
You'll need to install Ruby if you haven't already, and use the Ruby package manager, gem:
sudo gem install CoffeeTags
CoffeeTags was created for use with Vim and TagBar plugin, however it accepts most common ctags arguments, therefore the following:
coffeetags -R -f TAGS
will generate standard TAGS file which later can be used with Vim (standard :tag
command works as expected)
- ruby (either 1.8.7 or 1.9.2)
- Vim or Sublime Text and CTags plugin
- Vim
Just use coffeetags --help
-
get
coffeetags
gem install CoffeeTags
- add TagBar config to your .vimrc
coffeetags --vim-conf >> ~/.vimrc
TODO - I don't use ST myself, but PRs with HOWTO are welcome
CoffeeTags can work in 2 modes:
- tags only for functions (default)
- tags for functions and objects containing them
Second mode is activated by adding --include-vars
to command line arguments
You can add the config to your .vimrc (making sure that the old one is removed) by:
coffeetags --vim-conf >> ~/.vimrc
or (for 2nd mode)
coffeetags --include-vars --vim-conf >> ~/.vimrc
You can generate a special filetype plugin and tagbar will use that automatically.
This option is preferable if you want to keep your vimrc short.
coffeetags --vim-conf > ~/.vim/ftplugin/coffee/tagbar-coffee.vim
coffeetags [--include-vars] --vim-conf > ~/.vim/ftplugin/coffee/tagbar-coffee.vim
or if you're using pathogen
coffeetags [--include-vars] --vim-conf > ~/.vim/bundle/coffeetags/ftplugin/coffee/tagbar-coffee.vim
coffeetags --vim-conf > ~/.vim/bundle/coffeetags/ftplugin/coffee/tagbar-coffee.vim
- open your coffeescript file and open TagBar.
Done!
- squash all bugs
MIT