Sublime Forum

Sublime not using my .tmLanguage file

#1

I’m trying to make a syntax highlighter for autohotkey. I got the file from a textmate bundle. Created a folder called autohotkey in

C:\Users<name>\AppData\Roaming\Sublime Text\Packages

Renamed the syntax file from the textmake bundle to AutoHotkey.tmLanguage and placed it there. Whittled the file down til I got no error. However, I still did not see it listed under View > Apply syntax. I whittled the file all the way down to this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>uuid</key>
        <string>77AC23B6-8A90-11D9-BAA4-000A9584EC8D</string>
        <key>name</key>
        <string>AutoHotKey</string>
        <key>scopeName</key>
        <string>source.ahk</string>
        <key>fileTypes</key>
        <string>ahk</string>

        
    </dict>
</plist>

Still no go. It creates a .cache file in the same folder and recreates it when I shut down, delete the .cache file, and restart sublime. So it does see and parse the file.

What am I missing? Thanks

0 Likes

#2

Ah, I just figured it out: fileTypes has to be an array!

0 Likes

#3

I’d love to get syntax highlighting, auto-complete, & script launching working for autohotkey files.
It seems like you got your syntax highlighting working; Is it possible you could post some more detailed info as to how to get it setup??
thanks

0 Likes

#4

AutoHotkey is similar to AutoIt so I just use “AutoIt Script” syntax. Not perfect but it works fairly well.

0 Likes

#5

here is the file. just unzip into your packages folder
AutoHotKey.zip (9.91 KB)

0 Likes

#6

This is wonderful and extremely useful! I have a minor bug report: I like to use a semicolon at the beginning of my hotstrings, since it’s conveniently on the home row and never occurs naturally at the beginning of a word. However, your syntax highlighter interprets anything after a semicolon as a comment, even where AutoHotkey does not. It looks like:

::;cs::ComputerSherpa

where it should be:

::;cs::ComputerSherpa

Is there any way to fix this, or is that sort of discrimination outside the limitations of the syntax highlighter? Thanks!

0 Likes