Home Download Buy Blog Forum Support

ST3: Own syntax highlighting doesn't work anymore?

ST3: Own syntax highlighting doesn't work anymore?

Postby highend on Mon Apr 08, 2013 9:23 am

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 :)

XYS.zip
(1.17 KiB) Downloaded 86 times
highend
 
Posts: 94
Joined: Fri Jan 20, 2012 2:47 pm

Re: ST3: Own syntax highlighting doesn't work anymore?

Postby Binocular222 on Tue Jun 04, 2013 2:59 am

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 <dict> </dict> 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
Attachments
XYplorer.zip
(1.28 KiB) Downloaded 78 times
Last edited by Binocular222 on Sat Jun 08, 2013 5:22 pm, edited 2 times in total.
Binocular222
 
Posts: 55
Joined: Sat May 18, 2013 4:10 pm

Re: ST3: Own syntax highlighting doesn't work anymore?

Postby Binocular222 on Sat Jun 08, 2013 5:21 pm

Toggle comment: solved.
download this Comments.tmPreferences and make sure the ID (77AC23B6-8A90-11D9-BAA4-000A9584EC8X) match with XYplorer.tmLanguage
Attachments
Comments.zip
(520 Bytes) Downloaded 76 times
Binocular222
 
Posts: 55
Joined: Sat May 18, 2013 4:10 pm

Re: ST3: Own syntax highlighting doesn't work anymore?

Postby Binocular222 on Sun Jun 09, 2013 6:32 pm

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
Binocular222
 
Posts: 55
Joined: Sat May 18, 2013 4:10 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 20 guests