Skip to content

Instantly share code, notes, and snippets.

@shimaore
Created November 28, 2013 13:57
Show Gist options
  • Save shimaore/7692246 to your computer and use it in GitHub Desktop.
Save shimaore/7692246 to your computer and use it in GitHub Desktop.
Yet another ctags definition for coffee-script
--langdef=coffee
--langmap=coffee:.coffee
--langmap=coffee:.coffee.md
--regex-coffee=/(^|[ \t])*class ([A-Za-z_][A-Za-z0-9_]*\.)*([A-Za-z_][A-Za-z0-9_]*)/\3/c,class/
--regex-coffee=/(\.|@)([A-Za-z_][A-Za-z0-9_]*):[ \t]*[-=]>/\2/m,method/
--regex-coffee=/([A-Za-z_][A-Za-z0-9_]*)[ \t]*=.*[-=]>/\1/f,function/
--regex-coffee=/([A-Za-z][A-Za-z0-9_]*)[ \t]*[?+*-]?=/\1/v,variable/
--regex-coffee=/@([A-Za-z_][A-Za-z0-9_]*)[ \t]*[?+*-]?=/\1/f,field/
--regex-coffee=/@([A-Za-z_][A-Za-z0-9_]*):/\1/f,static field/
--regex-coffee=/([A-Za-z_][A-Za-z0-9_]*):/\1/f,field/
--regex-coffee=/\([ \t]*@([A-Za-z][A-Za-z0-9_]*)/\1/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){1}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){2}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){3}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){4}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){5}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){6}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){7}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){8}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
--regex-coffee=/\([ \t]*@?([A-Za-z_][A-Za-z0-9_.]*[ \t]*(=[ \t]*[^,)]+)?,){9}[ \t]*@([A-Za-z_][A-Za-z0-9_.]*)/\3/f,field/
@shimaore
Copy link
Author

I updated my .vimrc:

let g:tlist_coffee_settings = 'coffee;f:function;v:variable,c:classes,m:methods,f:fields'
let g:tagbar_type_coffee = {
  \ 'ctagstype' : 'coffee',
  \ 'kinds'     : [
    \ 'c:classes',
    \ 'm:methods',
    \ 'f:functions',
    \ 'v:variables',
    \ 'f:fields',
  \ ]
\ }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment