Skip to content

Instantly share code, notes, and snippets.

@awl
Created January 26, 2012 19:32
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save awl/1684578 to your computer and use it in GitHub Desktop.
Save awl/1684578 to your computer and use it in GitHub Desktop.
scala regular expressions for ctags and tagbar in vim
--langdef=Scala
--langmap=Scala:.scala
--regex-Scala=/^[ \t]*(((implicit|private|public)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*class[ \t]*([a-zA-Z0-9_]+)/\5/c,classes/
--regex-Scala=/^[ \t]*(((implicit|private|public)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*object[ \t]*([a-zA-Z0-9_]+)/\5/o,objects/
--regex-Scala=/^[ \t]*trait[ \t]*([a-zA-Z0-9_]+)/\1/t,traits/
--regex-Scala=/^[ \t]*case[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/r,cclasses/
--regex-Scala=/^[ \t]*abstract[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/a,aclasses/
--regex-Scala=/[ \t]*(((implicit|override|lazy|private|public)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*def[ \t]*([a-zA-Z0-9_=]+)[ \t]*.*[:={]/\5/m,methods/
--regex-Scala=/[ \t]*(((override|lazy|private|public)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\5/V,values/
--regex-Scala=/[ \t]*(((override|lazy|private|public)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*var[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\5/v,variables/
--regex-Scala=/^[ \t]*type[ \t]*([a-zA-Z0-9_]+)[ \t]*[\[<>=]/\1/T,types/
--regex-Scala=/^[ \t]*import[ \t]*([a-zA-Z0-9_{}., \t=>]+$)/\1/i,includes/
--regex-Scala=/^[ \t]*package[ \t]*([a-zA-Z0-9_.]+$)/\1/p,packages/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment