Posterous theme by Cory Watilo

Scala ctags and Vim Tagbar

One of the things I have been playing a lot nowadays is Scala. To work with it, I've been mostly using TextMate, but a couple of weeks ago I decided it was time to move on to another editor.

After some research, I went with Vim and MacVim. I knew it before, just the necessary to allow me file edition on remote servers, but was enough to get me started. I will probably post more about my ramp up in the future.

Anyway... Like I said, I've been playing a lot with Scala these times, and I wanted to do so with my new editor. Found this plugin for syntax and indentation. Cool!
Screen_shot_2011-05-11_at_8
But then I started to explore the plugins available for Vim (and they are not few) and found the great Tagbar, which is powered by Exuberant Ctags. Unfortunately, as far as I know, it does not support Scala.

In Ctags you can add language definitions on the .ctags file that goes under your home folder (~/.ctags). I found some examples on the Internet, but ended doing some modifications on it. After reading the Tagbar documentation I also came with the configuration you can find on this gist. I placed it inside the Tagbar plugin definition (~/.vim/plugin/tagbar.vim or, if you use pathogen, something like ~/.vim/bundle/tagbar/plugin/tagbar.vim).

What I got is something like this:
Screen_shot_2011-05-11_at_9
It's a first version. It's not great as are the definitions for Java or Ruby, which get organized as a tree, but might help you navigate through your Scala code. Enjoy :D

ps.: those tests are for the first application I did using Scala: a minesweeper copy game. I later ported it to Google's app engine. Check it out (left click opens the space, right places a flag on it, and the middle one open the surrounding area).

by

| Viewed
times