Sublime Forum

ST3: Own syntax highlighting doesn't work anymore?

#1

Hey,

I’m trying to switch from ST2 to ST3 but atm my own syntax highlighting file for “*.xys” files (for XYplorer, a Windows file manager) won’t work with ST3…

I’m using the default theme Monokai and ST3 portable.

I’ve copied my old XYS directory to D:\Tools\Sublime Text 3\Data\Packages\XYS
but no .xys file get’s syntax highlighted ever after restarting ST3.

Is it my XYS.tmLanguage file or was the Monokai theme changed in any way?

It would be nice if someone can take a short look at that file and tell me what I’m doing wrong :smile:

XYS.zip (1.17 KB)

0 Likes

#2

It works now, just a little mendment:

  • Define file type: from Line 5 - 15 and move scopeName to beginning.
  • Definition of comment change to comment.line.xys and comment.block.xys (Line 17-31)

Problem: these key bindings don’t work, I don’t know why:
{ “keys”: “ctrl+/”], “command”: “toggle_comment”, “args”: { “block”: false } },
{ “keys”: “ctrl+shift+/”], “command”: “toggle_comment”, “args”: { “block”: true } },
Fixed (see next post)


To improve: May add more definitions such as:
keyword.control.xys
constant.language
keyword.other.xys
punctuation.xys
constant.numeric.source.xys
string.quoted.xys
punctuation.quote.double
quoted.string.line.xys


Tip: You can rename the extension from .sublime-package to .zip → extract → view .tmlanguage file inside that .zip for reference
.sublime-package are located in
Sublime Text\Packages*.sublime-package


If you intend to make .sublime-completions too, then take a look at this problem with ST3: http://www.autohotkey.com/board/topic/46447-sublime-text-editor-very-nice/page-5#entry592694
I ended up deleting the .sublime-completions.
Of course it can be solve by
def on_query_completions(self, view, prefix, locations)
But I’m dumb at Python, so, unless someone post a solution, I do not recommend using .sublime-completions
XYplorer.zip (1.28 KB)

0 Likes

#3

Toggle comment: solved.
download this Comments.tmPreferences and make sure the ID (77AC23B6-8A90-11D9-BAA4-000A9584EC8X) match with XYplorer.tmLanguage
Comments.zip (520 Bytes)

0 Likes

#4

Updated version:

  • Totally rewrite all definitions using RegexBuddy. Highlighting is now much more robust and fool-proof
  • Combine all nesessary files into 1 .zip
  • Usage: simply extract to \Sublime Text\Data\Packages\
  • Add comments so that people can follow Regex
    Download from Github (I will regularly update):
    https://github.com/Binocular222/XYplorer-syntax-for-Sublime-Text
0 Likes