作者在 2008-04-10 21:40:40 发布以下内容
Syntax Highlighting
EditPlus supports powerful
and customizable syntax highlighting for HTML, CSS, PHP, ASP, Perl,
C/C++, Java, JavaScript and VBScript by default. Also, you can create
your own syntax file to support other programming languages.In order to add your own syntax type, you must create a syntax file and add it on Settings & Syntax page of the Preferences dialog box.
Syntax file is a plain text file which has ".STX" extension and should be written in predefined format. The format is very simple. The fastest way is to look into the sample .STX file such as JS.STX for JavaScript files (*.JS).
#TITLE=C/C++
#DELIMITER=,()}[]-+*%/="'~!&|\<>?:;.
#QUOTATION1='
#QUOTATION2="
#CONTINUE_QUOTE=n
#LINECOMMENT=//
#LINECOMMENT2=
#COMMENTON=/*
#COMMENTOFF=*/
#COMMENTON2=
#COMMENTOFF2=
#ESCAPE=\
#CASE=y
#PREFIX1=
#PREFIX2=
#PREFIX3=
#PREFIX4=
#PREFIX5=
#SUFFIX1=
#SUFFIX2=
#SUFFIX3=
#SUFFIX4=
#SUFFIX5=
#HTML_EMBEDDED=
#SCRIPT_BEGIN=
#SCRIPT_END=
#HEREDOC=
#AUTOCASE=
#NUMBER_PATTERN=cpp
#SPECIAL_STX=cpp
All statements must be prefixed with '#' sign.
#TITLE
#TITLE
The title of 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
delimiter 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 - #PREFIX5 Specify keyword prefix character. Any word that follows the prefix will be treated as a keyword.
#SUFFIX1 - #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.
#HEREDOC Specify a string for heredoc in Perl and PHP files. For example, #HEREDOC=<<EOF.
#AUTOCASE Specify 'y' if you would like to use the automatic keyword case correction feature.
#NUMBER_PATTERN 'cpp' for C/C++ number syntax highlighting.
#SPECIAL_STX 'html'
for HTML sytax file, 'cpp' for C/C++ syntax file, and 'perl' for Perl
syntax file. Leave blank for all other syntax files.
You
can also insert comment line in syntax file. Comment line must begin
with semicolon(;). If you need to add a keyword which begins with
semicolon, you must prefix an escape character '^' to it.
Keyword groups
#KEYWORD=Reserved words
abstract
boolean
break
#KEYWORD=Compiler directives
...
Each keyword group begins with #KEYWORD statement
with optional description of the group. Keyword list follows from the
next line. If you need to include '#' sign into a keyword, you must
prefix an escape character '^' to it like this: '^#'. In this case, the
'#' sign should not be included in #DELIMITER statement. You can
specify up to 10 keyword groups.
User files repository
EditPlus web site has a collection of user files (stx, ctl, acp files) on User Files page. You can submit your own syntax file to <submit@editplus.com> if you would like to share your file with other users.