Liftweb + ctags + vim

This is how I set up /Lift/, ctags, and vim (on OS X and Ubuntu):

Add some scala definition to ctags:

ty@Astra:~$ cat /home/ty/.ctags
--langdef=scala
--langmap=scala:.scala
--regex-scala=/^[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\1/c,classes/
--regex-scala=/^[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\1/t,traits/
--regex-scala=/^[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
--regex-scala=/^[ \t]*def[ \t]+([a-zA-Z0-9_]+)/\1/m,methods/
--regex-scala=/^[ \t]*val[ \t]+([a-zA-Z0-9_]+)/\1/C,constants/
--regex-scala=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)/\1/l,local variables/
--regex-scala=/^[ \t]*package[ \t]+([a-zA-Z0-9_.]+)/\1/p,packages/
--regex-scala=/^[ \t]*case class[ \t]+([a-zA-Z0-9_]+)/\1/c,case classes/
--regex-scala=/^[ \t]*object[ \t]+([a-zA-Z0-9_]+)/\1/o,objects/

Build the tags file:

ty@Astra:~$ ctags -h [".scala"] -R -f liftags \
/home/ty/liftweb-read-only/liftweb/

I prefer to keep the tags file, in this case liftags, in the root of home. Put it where you want.

Add the tags location to ~/.vimrc

set tags=/home/ty/liftags

Now you can open a file and execute

:tag LiftSession

and jump to the file.

Leave a Reply