简体   繁体   中英

How can I generate a TAGS file for Groovy classes for use in VIM/Emacs

丰富的cTags不支持Groovy。

You need to create a ctags config file and put it in your home directory. Here is one that I use for actionscript(don't remember where I found it). Look at http://ctags.sourceforge.net/ctags.html and see langdef, langmap, and regex options for more info.

ctags.cnf

--langdef=actionscript
--langmap=actionscript:.as
--regex-actionscript=/^[ \t]*[(private|public) ( \t)]*function[ \t]+([A-Za-z0-9_]+)[ \t]*\(/\1/f,function,functions/
--regex-actionscript=/^[ \t]*public function (set|get)[ \t]+([A-Za-z0-9_]+)[ \t]*\(/\1 \2/p,property,properties/
--regex-actionscript=/^[ \t]*private var[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/v,private,private variables/
--regex-actionscript=/^[ \t]*public var[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/u,public,public variables/
--regex-actionscript=/.*\.prototype \.([A-Za-z0-9 ]+)=([ \t]?)function( [ \t]?)*\(/\1/f,prototype,prototype functions/
--regex-actionscript=/^[ \t]*class[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/c,class,classes/

Also if you use the TList Plugin I have this in my vimcrc

let tlist_actionscript_settings = 'actionscript;c:class;f:method;p:property;v:private variables;x:variables;u:public variables'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM