Syntax file format

From EditPlus Wiki
Jump to: navigation, search

EditPlus uses a simple, plain text syntax file format to describe a programming language for syntax highlighting.

EditPlus comes with 12 syntax (.stx) files, located in "C:\Program Files\EditPlus 2", which can be opened and modified within EditPlus. You can also create your own custom syntax file (or use one created by someone else) and configure EditPlus to associate it with a certain file extension by going to Tools > Preferences > Files > Settings & Syntax.

To download syntax files, see syntax files.

Contents

File Format

Comments

You can comment a line by beginning it with a ';' (semicolon). If you need to add a keyword which begins with semicolon, you must prefix it with an escape character '^' (caret).

Header Information

If a header statement has no value, leave it blank after the '=' (equal sign).

#TITLE= 
The title of the syntax file. It should be located at the first line of the file. Otherwise, EditPlus cannot load it.
#DELIMITER= 
Specify delimiters for parsing keywords. You don't need to specify the space character and the tab character here, since those are treated as delimiters by default.
#QUOTATION1= 
Specify quotation mark. Enter only one character.
#QUOTATION2= 
Specify alternate quotation mark. Enter only one character.
#CONTINUE_QUOTE= 
This option allows un-terminated quotation to be continued to next line. 'y' for yes and 'n' for no. 'n' is default value.
#LINECOMMENT= 
Specify a string which turns on line comment. If you prefix ^! to the line comment string, it works only when located at the beginning of line.
#LINECOMMENT2= 
Specify a string which turns on line comment 2. If you prefix ^! to the line comment string, it works only when located at the beginning of line.
#COMMENTON= 
Specify a string which turns on block comment.
#COMMENTOFF= 
Specify a string which turns off block comment.
#COMMENTON2= 
Specify a string which turns on block comment 2.
#COMMENTOFF2= 
Specify a string which turns off block comment 2.
#ESCAPE= 
Specify escape character. Enter only one character here.
#CASE= 
Specify case sensitivity. 'y' for yes and 'n' for no. Default value is 'n'.
#PREFIX1= through #PREFIX5= 
Specify keyword prefix character. Any word that follows the prefix will be treated as a keyword.
#SUFFIX1= through #SUFFIX5= 
Specify keyword suffix character. Any word that precedes the suffix will be treated as a keyword.
#HTML_EMBEDDED= 
Specify 'y' if it is HTML-embedded script such as PHP. See 'PHP.STX' for an example.
#SCRIPT_BEGIN= 
Specify the string which turns on HTML-embedded script. Valid only if ; #HTML_EMBEDDED is 'y'. See 'PHP.STX' for an example.
#SCRIPT_END= 
Specify the string which turns off HTML-embedded script. Valid only if ; #HTML_EMBEDDED is 'y'. See 'PHP.STX' for an example.
#NUMBER_PATTERN= 
'cpp' for C/C++ number syntax highlighting.
#SPECIAL_STX= 
'html' for HTML syntax file, 'cpp' for C/C++ syntax file, and 'perl' for Perl syntax file. Leave blank for all other syntax files
#AUTOCASE= 
Automatic case correction.
#SKIP_QUOTE= 
Avoid problems like SCRIPT_END characters within quotes. For example "?>" in php should not close the script highlighting
#REGEX_QUOTE= 
The character used to delimit a regular expression constant. (As of version 2.20)
#HEREDOC= 
Delimiter for heredoc strings. Formatted like "<<EOF". (As of version 2.20)

Keyword groups

Each of a maximum of 5 keyword groups begins with the #KEYWORD statement and an optional description of the group. The keyword list follows from the next line. If you need to include a '#' sign into a keyword, you must prefix it with an escape character '^' (caret) like this: '^#'. If such keywords exist, the '#' sign should not be included in #DELIMITER header statement above.

#KEYWORD=Reserved words
abstract
boolean
break

#KEYWORD=Compiler directives
...

Other File Formats

External Links

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox