05 December 2012

VIM Syntax Highlighting for Scala: A Bash One-Liner

Just for posterity, here is a Bash one-liner to download the VIM plugins to handle syntax highlighting for Scala:
$ mkdir -p ~/.vim/{ftdetect,indent,syntax} && for d in ftdetect indent syntax ; do wget --no-check-certificate -O ~/.vim/$d/scala.vim https://raw.githubusercontent.com/scala/scala-dist/master/tool-support/src/vim/$d/scala.vim; done
Update

Here is a solution using cURL submitted by Joe:
mkdir -p ~/.vim/{ftdetect,indent,syntax} && for d in ftdetect indent syntax ; do curl -o ~/.vim/$d/scala.vim https://raw.githubusercontent.com/scala/scala-dist/master/tool-support/src/vim/$d/scala.vim; done

17 comments:

  1. Thanks bro, works saved me some work!

    ReplyDelete
  2. Substituting cURL:

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

    ReplyDelete
  3. I can use the 5 minutes I gained getting Scala syntax highlighting from this post to tell you how much I like it :). But seriously, thanks! I know I'll use it again on some other machine ... somewhere.

    ReplyDelete
  4. Nice work Bruce. (hope all is well)

    ReplyDelete
  5. Thanks, that saved me a lot of time! I had to change the url to `https://raw.githubusercontent.com` to actually be able to download the files (I'm guessing that Github changed it recently, in which case you might want to update it in your post as well)

    ReplyDelete
  6. Thank you for this great solution!

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. updated url:

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

    ReplyDelete
  9. This is a quick way, but Vundle or Pathogen would be a better approach.

    If you are interested I recently wrote an article about programming Scala in Vim - http://lauris.github.io/vim/2014/08/21/scala-in-vim/

    ReplyDelete