SyntaxDefinitionHelper
This is a plugin/module for Sublime Text 2 to aid in the creation of language syntax definitions.
Details
Installs
- Total 368
- Win 224
- Mac 87
- Linux 57
Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | Dec 6 | Dec 5 | Dec 4 | Dec 3 | Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Syntax Definition Helper
This plug-in contains two tools to aid in the creation of basic syntax definition files.
The Problem
Working with P-List and JSON files can be annoying when attempting to deal with syntax definitions. Furthermore, not looking directly at a file of the syntax definition type you're creating can cause you to miss tokens. Even further than that, people don't seem to understand regular expressions well enough to make basic regular expressions.
For these reasons, and extreme laziness on my part, I made these tools. The Syntax Definition Helper creates a new syntax definition based on user input while the user is staring at a file that contains no syntax highlighting. It creates very basic regular expressions based off of the selected text, and allows the user to choose a scope and a comment, as well as edit the regular expression for that token.
The syntax definition edit helper opens up the current syntax defintion, and allows the user to add basic patterns to the definition in exactly the same way as the Syntax Definition Helper.
Getting Started
- Install
-> Install from the Package Manager
-> Install by copying the package to your packages directory
installation by hand: http://sublimetext.info/docs/extensibility/packages.html#installation-of-packages-with-sublime-package-archives
Once installed:
Press ALT-CTRL-6 to start the Syntax Definition Helper Wizard Press ALT-CTRL-7 to start the Syntax Definition Edit Helper WizardAlternatively, you can define a new key binding for this command.
How to Use
Create A Syntax Definition
- Open a file that doesn't contain a syntax definition
- Press ALT-CTRL-6
- Type "yes" and hit enter
- Type the file extensions this will apply to (Ex: .asm .txt .x86) and hit enter
- Give the language a name and hit enter.
- Press Enter or enter your own UUID
- Name the language root scope. This should be something followed by the file extension. (Ex: For XML I would enter Text.XML)
- Select a group of tokens (for example, command tokens -- if end last next continue for while loop do) then click into the dialog entry box and hit enter
- Edit the regex and hit enter.
- Add a comment to the group, describing it (ex: Control Tokens), and hit enter.
- Choose a named scope from the default color scheme list (ex: comment.py), and change the final extension to the extension you used for the root scope. (xml ex: comment.xml)
- Repeat 8-11 until you run out of groups or tokens to colorize.
- Enter "no" at the token prompt and hit enter.
- Wait for Sublime Text 2 to save and reload syntax definitions.
- Set the syntax to your new syntax defintion and observer the colors.
Edit A Syntax Definition
- Verify that the syntax in the file you're planning on editing is set to the correct syntax.
- Press ALT-CTRL-7
- Press Enter
- Perform the steps 8-15 from the above set of instructions.
Clicking into the text edit area in the dialog and pressing escape will cancel the entire process at any time. If you change your mind, and decide to not make the changes, then do this.