0

I've used Sublime Text 2 and 3 for years now, for doing Rails work. I had it setup to use the ApplySyntax package to force *.html.haml files to use the HAML syntax package (from TextMate). Now, I can't get to remember that choice. I've tried everything, including wiping out the entire installation, and starting over from scratch. No matter what I do, ST will open HAML files as "Rails/Ruby HAML" syntax, and NOT the "Ruby HAML" choice on the top-level menu.

I can't get ApplySyntax to force the choice. The option to "Open all files with this extension as..." does nothing. I've disabled the Ruby package to get rid of the submenu of choices, and this then destroys syntax highlighting of the Ruby sections of the HAML files, like the TextMate bundle was relying on it for that part.

This is what I get in the console log when I force the syntax change with "Open all":

Assigning haml to syntax Packages/Haml/Syntaxes/Ruby Haml.tmLanguage

And this is what I get when I open the very next HAML file:

reloading settings Packages/User/Ruby Haml.sublime-settings

I don't know what's changed, and I can't figure out how to get it back. Does anyone have this sorted? TextMate has COMPLETELY different shortcuts, and VS Code is so slow, I can watch it paint its syntax highlighting when opening a file on my $4,000 MBP, so I'd really like to stick with ST3 if I can figure out how to make this work again.

David Krider
  • 886
  • 12
  • 27
  • The menu item for `View > Syntax > Open All with Current Extension As` is a Sublime thing; it will modify the `sublime-settings` file for the syntax that you choose to include an `extensions` key, and that will make Sublime open the files with that syntax. Are you still using the `ApplySyntax` package? It may be getting in the way of this and forcing it the other way through settings of its own. Can you provide a link to the syntax bundle you're using for HAML for testing purposes? – OdatNurd Dec 13 '19 at 17:49
  • I've removed and reinstalled ApplySyntax several times trying to sort this out. It's currently not installed. I'm trying to use this package: https://packagecontrol.io/packages/Haml. It gives some syntax highlighting to embedded JS in HAML files. – David Krider Dec 13 '19 at 20:53
  • Hmm.. the `Haml` package has no plugins, so if `ApplySyntax` isn't installed then the menu command to `Open all with` should work; do you have any other packages that might be trying to flip syntaxes somehow? – OdatNurd Dec 13 '19 at 21:25
  • I only have Package Control, the Flatland theme, and that HAML package installed. – David Krider Dec 13 '19 at 21:40

0 Answers0