|
编写PHP代码我喜欢用EditPlus,但对于它具体的语法配置方法不是很了解,后来在Google上搜了很久,终于找到了关于它的语法参考,但是是英文版的,慢慢看,你会喜欢上EditPlus的。
EditPlus supports powerfuland customizable syntax highlighting for HTML, CSS, PHP, ASP, Perl,C/C++, Java, Javascrīpt and VBscrīpt by default. Also, you can createyour own syntax file to support other programming languages.
Inorder to add your own syntax type, you must create a syntax file andadd it on Settings & Syntax page of the Preferences dialog box.
Syntaxfile is a plain text file which has ".STX" extension and should bewritten in predefined format. The format is very simple. The fastestway is to look into the sample .STX file such as JS.STX for Javascrīptfiles (*.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=
#scrīpt_BEGIN=
#scrīpt_END=
#HEREDOC=
#AUTOCASE=
#NUMBER_PATTERN=cpp
#SPECIAL_STX=cpp
All statements must be prefixed with '#' sign.
#TITLE
The title of syntax file. It should be located at the first line of the file. Otherwise, EditPlus cannot load it.
#DELIMITER
Specifydelimiters for parsing keywords. You don't need to specify the spacecharacter and the tab character here, since those are treated asdelimiter 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
Specifya string which turns on line comment. If you prefix ^! to the linecomment string, it works only when located at the beginning of line.
#LINECOMMENT2
Specifya string which turns on line comment 2. If you prefix ^! to the linecomment 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 scrīpt such as PHP. See 'PHP.STX' for an example.
#scrīpt_BEGIN
Specify the string which turns on HTML-embedded scrīpt. Valid only if #HTML_EMBEDDED is 'y'. See 'PHP.STX' for an example.
#scrīpt_END
Specify the string which turns off HTML-embedded scrīpt. 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 Perlsyntax file. Leave blank for all other syntax files.
Youcan also insert comment line in syntax file. Comment line must beginwith semicolon(;). If you need to add a keyword which begins withsemicolon, 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 statementwith optional descrīption of the group. Keyword list follows from thenext line. If you need to include '#' sign into a keyword, you mustprefix an escape character '^' to it like this: '^#'. In this case, the'#' sign should not be included in #DELIMITER statement. You canspecify 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.
另外附上我喜欢的字体文件:
AndaleMo.rar
(71.56 KB, 下载次数: 111)
,非常纤细好看。
[ 本帖最后由 szlinz 于 2008-4-20 11:36 编辑 ] |
|