Sublime Syntax and Theme Package Reader

  • Somebody asked a while ago about having Sublime-like syntax highlighting in Notepad++ (obviously they work completely differently). It got me to wondering about it, so I made a thing…

    …meaning a generic lexer. I started with a simple enough language (i.e. this) to test with, but in theory should be able to be extended to any language definition file that Sublime (also TextMate) uses for parsing files. I also have it loading the a theme file that Sublime uses too.

    So, I don’t really know what to do from here. There seems like alot of potential over Scintilla’s built in lexers.

  • I can’t answer your question per se but I basically have exactly the same opinion as the OP here whom I think you’re referring to. I spent a little time today investigating how the two programs handle syntax highlighting (no previous experience in this) and obviously the TextMate configs are accessible enough. It seems like a neat idea for a plugin to be able to import .tmLanguage and .tmTheme files to acheive the end goal here? Would be really interested to hear more.

  • @IanD_1090 You are correct; that was the post that got me thinking about it.

    I was going off the Sublime files for now, which carry the same information as the TextMate files, just in a more readable YAML format. The original code I had for this example was horribly coded, I was more just interested to see if it was even possible. I’ve started doing a re-write of it and make it a bit more modular so it isn’t strictly for embedding as a Notepad++ plugin. I’ve made decent progress in my copious (read: limited) free time. I think this has alot of potential since this type of highlighting actually has context with parts of the file, meaning you can easily do things like pull out the functions for the function list (instead of relying on only partially working regexs). Also you can add new languages without ever having to recompile anything, as the Scintilla lexers are now.

    There’s still alot of stuff to do before it is actually ready to be released as a plugin, but glad to see someone is interested.

Log in to reply