How to customise file type to syntax associations in Sublime Text?

前端 未结 6 1333
时光说笑
时光说笑 2020-11-28 17:30

I\'d like Sublime 2 editor to treat *.sbt files (to highlight syntax) as Scala language, same as *.scala, but I can\'t find where to set this up. Do you happen to know?

6条回答
  •  醉酒成梦
    2020-11-28 18:14

    I've found the answer (by further examining the Sublime 2 config files structure):

    I was to open

    ~/.config/sublime-text-2/Packages/Scala/Scala.tmLanguage
    

    And edit it to add sbt (the extension of files I want to be opened as Scala code files) to the array after the fileTypes key:

    
      bundleUUID
      452017E8-0065-49EF-AB9D-7849B27D9367
      fileTypes
      
        scala
        sbt
      
      ...
    

    PS: May there be a better way, something like a right place to put my customizations (insted of modifying packages themselves), I'd still like to know.

提交回复
热议问题