0

I have added a scala syntax file from https://github.com/derekwyatt/vim-scala/blob/master/syntax/scala.vim as ~/.vim/syntax/scala.vim to an ubuntu system

$ ll ~/.vim/syntax/scala.vim
-rw-rw-r-- 1 steve steve 11202 Dec 11 07:48 /home/steve/.vim/syntax/scala.vim

But vim MyFile.scala is still vanilla white - no syntax applied. Any hints here?

7
  • You need the whole thing. Commented Dec 11, 2016 at 17:28
  • @romainl Please expand on your comment - what whole thing? Commented Dec 11, 2016 at 17:29
  • It is about html but should help for scala as well: stackoverflow.com/questions/3853028/… Commented Dec 11, 2016 at 17:55
  • The whole plugin of course. Commented Dec 11, 2016 at 18:37
  • @romainl The OP stated the objective is only for the syntax handler: not an entirely new plugin. Commented Dec 11, 2016 at 20:30

1 Answer 1

1

You'll need to tell Vim to apply this syntax file for Scala files.

ftdetect/scala.vim contains the logic for detecting whether this file is a Scale file, and will set the filetype accordingly. This will also set the syntax setting. If you add this file, things should work.

In addition to that, you'll almost certainly also want:

These four files account for the bulk of the plugin, so you might as well get the entire thing. If you want to downsize things, then removing some files is usually easier than cherry-picking files until it works.

Sign up to request clarification or add additional context in comments.

1 Comment

Concluding note is very sensible. Wanted to avoid going the plugin-way but I ended up losing an hour until I had it all figured out

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.