Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ctags file for better parsing of ruby,js

  • Loading branch information...
commit 2e0bd87b8d863b2027e7514af58f2c84f4aa6274 1 parent bff8652
@skwp authored
Showing with 27 additions and 0 deletions.
  1. +1 −0  Rakefile
  2. +26 −0 ctags/ctags
View
1  Rakefile
@@ -14,6 +14,7 @@ task :install => [:submodules] do
linkables += Dir.glob('git/*') if want_to_install?('git')
linkables += Dir.glob('irb/*') if want_to_install?('irb/pry')
linkables += Dir.glob('ruby/*') if want_to_install?('ruby (gems)')
+ linkables += Dir.glob('ctags/*') if want_to_install?('ctags config (better js/ruby support)')
linkables += Dir.glob('vimify/*') if want_to_install?('vimification of mysql/irb/command line')
linkables += Dir.glob('{vim,vimrc}') if want_to_install?('vim')
linkables += Dir.glob('zsh/zshrc') if want_to_install?('zsh')
View
26 ctags/ctags
@@ -0,0 +1,26 @@
+--langdef=js
+--langmap=js:.js
+--regex-JavaScript=/([A-Za-z0-9._$\(\)]+)[ \t]*[:=][ \t]*function[ \t]*\(/\1/m,method/
+--regex-JavaScript=/([A-Za-z0-9._$\#\(\)]+)[ \t]*[:][ \t]*([A-Za-z0-9._\-\#\'\"]+)[ \t]*/\1/p,property/
+--regex-JavaScript=/([A-Za-z0-9._$\#\(\)]+)[ \t]*[:][ \t]*([A-Za-z0-9\'\"._\-\#\(]+)[ \t]*\{/\1/p,property/
+--regex-JavaScript=/var ([A-Za-z0-9._$\#]+)[ \t]*[=][ \t]*([A-Za-z0-9._'"\$\#\[\{]+)[,|;]/\1/v,variable/
+--regex-JavaScript=/([A-Za-z0-9._$\#]+)[ \t]*[=][ \t]*([A-Za-z0-9._'"\$\#]+)extend\(/\1/c,class/
+
+--regex-ruby=/(^|[:;])[ \t]*([A-Z][[:alnum:]_]+) *=/\2/c,class,constant/
+--regex-ruby=/(^|;)[ \t]*(has_many|belongs_to|has_one|has_and_belongs_to_many)\(? *:([[:alnum:]_]+)/\3/f,function,association/
belongs_to
has_one 
has_and_belongs_to_many

These are rails functions not ruby reserved words. Should they be under something rails specific?

@skwp Owner
skwp added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+--regex-ruby=/(^|;)[ \t]*(named_)?scope\(? *:([[:alnum:]_]+)/\3/f,function,named_scope/
+--regex-ruby=/(^|;)[ \t]*expose\(? *:([[:alnum:]_]+)/\2/f,function,exposure/
+--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2/f,function,aasm_event/
+--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2!/f,function,aasm_event/
+--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2?/f,function,aasm_event/
+
+--langdef=markdown
+--langmap=markdown:.md.markdown.mdown.mkd.mkdn
+--regex-markdown=/^#[ \t]+(.*)/\1/h,heading1/
+--regex-markdown=/^##[ \t]+(.*)/\1/h,heading2/
+--regex-markdown=/^###[ \t]+(.*)/\1/h,heading3/
+
+--langdef=coffee
+--langmap=coffee:.coffee
+--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=.*->.*$/\1/f,function/
+--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/
Please sign in to comment.
Something went wrong with that request. Please try again.