VimでScalaのsyntax highlightを有効にする

“VIM for (PHP) Programmers” slides and resources » Andrei Zmievski を展開して使っている環境でScalaのsyntax highlightを有効にするメモ

  1. http://www.vim.org/scripts/script.php?script_id=1780 から scala.vim をダウンロードして ~/.vim/syntax/ に配置する
  2. ~/.vim/filetype.vimを編集する

    "
    " Filetype detection
    "
    augroup filetypedetect
        " Detect .txt as 'text'
        autocmd! BufNewFile,BufRead *.txt setfiletype text
        autocmd! BufNewFile,BufRead *.scala setfiletype scala (追加)
    augroup END
    

これで *.scala ファイルを開いたときにScalaのsyntax highlightが有効になります