Monday, 12 January 2015

Get syntax highlighting and formatting for Scala in Vim


There are a few copies of some .vim files floating around the internet which provide syntax highlighting and nice indentation for .scala and .sbt files. I have put them onto my github and here is a one liner to download the scripts and store them in the the vim configuration directory so they are picked up when you use vim: 

mkdir -p ~/.vim/{ftdetect,indent,syntax} && for d in ftdetect indent syntax ; do curl -o ~/.vim/$d/scala.vim https://raw.githubusercontent.com/apojha/scala-vim-support/master/$d/scala.vim ; done

Note that you must have 'syntax on' in your .vimrc file (or just ':syntax on' when your scala file is open in vim but that might get tedious if you are editing a lot of files in which case go use something sensible like IntelliJ. . :-) )

No comments:

Post a Comment

Scala with Cats: Answers to revision questions

I'm studying the 'Scala with Cats' book. I want the information to stick so I am applying a technique from 'Ultralearning&#...