Ⅰ. 插件描述
Generates ctags-compatible tags from js and coffeescript codeⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'elentok/supertagger'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'elentok/supertagger'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'elentok/supertagger'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/elentok/supertagger
Ⅳ. 文档说明
SuperTagger
Generates ctags-compatible tags for javascript, coffeescript, scss, and ruby
(ctags supports ruby, but supertagger adds some missing tags)
Vim plugin
This repository can be used as a Vim plugin,
if you are using Vundle just add the following line to your .vimrc and run :BundleInstall
Bundle 'elentok/supertagger'The 'supertagger' command
- looks for an existing "tags" file in this directory or a parent directory
- if no "tags" file was found, looks for a ".git" folder and creates the "tags" file there
- The 'tagger' command also calls ctags to generate tags for Ruby code and everything else
Ignoring certain files and directories
In the root of your project create a file called ".tagsignore"
where each line is a pattern to exclude.
For example:
node_modules/*
components/*
tmp/*Supported formats
Javascript:
Class1 = Backbone.extend({
initialize: function() { ... }
});
Namespace1.Class2 = L.Class.extend({
doSomething: function(someValue) { ... }
});
Class1.jsStaticMethod = function() { ... }
Namespace3.JsStaticClass = { .. }
Coffeescript:
Animal = Backbone.extend
initialize: (@name) ->
speak: ->
console.log "Hi, I'm #{@name}"
Animal.Dog = Animal.extend
speak: ->
console.log "woof"
class SomeClass
method1: ->
method2: =>
class Namespace1.ExtendingClass extends SomeClass
method4: ->
AnObject.coffeeStaticMethod = ->
Namespace3.CoffeeStaticClass =
SCSS:
@mixin mixin1 { }
@mixin mixin2($var1) { }
Ruby:
class Module1::Class1
module Module1::SubModule
class Module1::SubModule::Class2