Skip to content

Instantly share code, notes, and snippets.

@jg
Forked from anonymous/.ctags
Created November 18, 2012 10:41
Show Gist options
  • Save jg/4104508 to your computer and use it in GitHub Desktop.
Save jg/4104508 to your computer and use it in GitHub Desktop.
Scala ctags conf, Vim tagbar integration
--langdef=Scala
--langmap=Scala:.scala
--regex-Scala=/^[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/c,classes/
--regex-Scala=/^[ \t]*object[ \t]*([a-zA-Z0-9_]+)/\1/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]*def[ \t]*([a-zA-Z0-9_=]+)[ \t]*.*[:=]/\1/m,methods/
--regex-Scala=/[ \t]*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/V,values/
--regex-Scala=/[ \t]*var[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/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/
" Scala {{{3
let type_scala = {}
let type_scala.ctagstype = 'Scala'
let type_scala.kinds = [
\ {'short' : 'p', 'long' : 'packages', 'fold' : 1 },
\ {'short' : 'V', 'long' : 'values', 'fold' : 0 },
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0 },
\ {'short' : 'T', 'long' : 'types', 'fold' : 0 },
\ {'short' : 't', 'long' : 'traits', 'fold' : 0 },
\ {'short' : 'o', 'long' : 'objects', 'fold' : 0 },
\ {'short' : 'a', 'long' : 'aclasses', 'fold' : 0 },
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0 },
\ {'short' : 'r', 'long' : 'cclasses', 'fold' : 0 },
\ {'short' : 'm', 'long' : 'methods', 'fold' : 0 }
\ ]
let type_scala.sro = '.'
let type_scala.kind2scope = {
\ 'T' : 'type',
\ 't' : 'trait',
\ 'o' : 'object',
\ 'a' : 'abstract class',
\ 'c' : 'class',
\ 'r' : 'case class'
\ }
let type_scala.scope2kind = {
\ 'type' : 'T',
\ 'trait' : 't',
\ 'object' : 'o',
\ 'abstract class' : 'a',
\ 'class' : 'c',
\ 'case class' : 'r'
\ }
let s:known_types.scala = type_scala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment