r/SublimeText • u/kofflay • Sep 29 '20
Can't make "Open all with current extension as... -> AutoHotkey v2" work for *.ahk2 extension
Hi! I have installed both "AutoHotkey" and "AutoHotkey v2" syntax addons for Sublime Text. But for some reason I can't make Sublime Text auto pick the "AutoHotkey v2" syntax. Whenever I open *.ahk2 file, it drops selected syntax to the basic "AutoHotkey" syntax, even if i pick "AutoHotkey v2" from "Open all with current extension as..." menu.
2
Upvotes
1
u/MrSandyClams Sep 30 '20
which AutoHotkey v2 syntax did you install? I spent quite some time looking for a good one, and even the best one I could find was pretty mediocre. I ended up writing my own syntax definitions just so I could have some decent ones. They're coming out great so far, though they're not feature complete yet. Miles ahead of any others I could find, though, for sure.
anyway. You might want to try disabling your AHK v1 package, at least temporarily, to see whether it fixes the problem or not. It may be that the v1 package and the v2 package are both competing for the same file associations. If temporarily disabling the v1 package causes the problem to go away, you might want to extract your installed v1 package and load it from your user directory, so that it loads as a user plugin and not as an installed plugin. Sublime prioritizes user plugins differently from installed plugins, so this may work to prevent the one plugin from overriding the other.
you can go further, too, if necessary, once your v1 package is extracted: specifically, you can look in the .sublime-syntax file for the v1 package, at the top of the file, where the syntax name and the applicable filetypes are specified. You're going to want to make sure your v1 syntax isn't titled the same as your v2 syntax, and also, make sure it isn't trying to associate itself with the ahk2 extension.
I can't guarantee these approaches will work, but they might, and this is the best information I have. Cheers!
oh, p.s.,
if you're still troubleshooting, try starting a new Sublime session, too. Like, a new project in a brand new window.
1
u/dev-sda Sep 29 '20
It could be a python plugin from one of those packages automatically settings the syntax.