首页 > 代码库 > 让 Editplus 支持 SQL 语法高亮【提供参考方法,有更好的语法文件可以自己替换】

让 Editplus 支持 SQL 语法高亮【提供参考方法,有更好的语法文件可以自己替换】

#TITLE=SQL  
; SQL syntax file written by xxx   
#DELIMITER=,(){}[]-+*%/=~!&|<>?:;.  
#QUOTATION1=  
#CONTINUE_QUOTE=n  
#LINECOMMENT=--  
#LINECOMMENT2=#  
#COMMENTON=/*  
#COMMENTOFF=*/  
#ESCAPE=\  
#SPECIAL_STX=SQL   
#KEYWORD=SQL Tags  
;var type  
sql_variant  
datetime  
smalldatetime  
float  
real  
decimal  
money  
smallmoney  
bigint 
int  
smallint  
tinyint  
bit  
ntext  
text 
image 
integer  
timestamp  
uniqueidentifier 
nvarchar 
nchar 
varchar 
char  
varbinary  
binary 
;database 
entities 
COLUMN 
CONSTRAINT
CURSOR 
DATABASE  
INDEX
TABLE 
VIEW 
ENGINE
#KEYWORD=Entities  
;index type  BTREE  HASH  
;character set  utf8  latine  
;MySQL features  InnoDB   
#KEYWORD=Reserved words 
;Common  
ADD  
ALL 
ALTER 
AND 
ANY  
AS  
ASC
AUTHORIZATION
AVG 
BACKUP 
BEGIN  
BETWEEN 
BREAK  
BROWSE 
BULK 
BY 
CASCADE
CASE 
CHARACTER
CHECK  
CHECKPOINT
CLOSE  
CLUSTERED 
COALESCE 
COMMIT 
COMMENT  
COMMITTED 
COMPUTE 
CONFIRM  
CONNECT 
CONTAINS  
CONTAINSTABLE
CONTINUE 
CONTROLROW
CONVERT  
COUNT  
CREATE
CROSS 
CURRENT  
CURRENT_DATE
CURRENT_TIME 
CURRENT_TIMESTAMP 
CURRENT_USER 
DBCC  
DEALLOCATE 
DECLARE 
DEFAULT 
DELETE  
DENY  
DESC 
DISK 
DISTINCT 
DISTRIBUTED 
DOUBLE 
DROP  
DUMMY 
DUMP  
ELSE 
END 
ERRLVL
ERROREXIT 
ESCAPE 
EXCEPT  
EXEC
EXECUTE  
EXISTS 
EXIT  
FETCH 
FILE  
FILLFACTOR
FLOPPY
FOR 
FOREIGN 
FREETEXT 
FREETEXTTABLE
FROM 
FULL 
GOTO  
GRANT 
GROUP  
HAVING  
HOLDLOCK 
IDENTITY
IDENTITY_INSERT
IDENTITYCOL
IF
IN 
INNER 
INSERT
INTERSECT
INTO 
IS 
ISOLATION 
JOIN 
KEY  
KILL 
LEFT
LEVEL 
LIKE  
LINENO
LOAD 
MAX  
MIN 
MIRROREXIT 
NATIONAL 
NOCHECK
NONCLUSTERED  
NOT 
NULL  
NULLIF 
OF
 OFF 
 OFFSETS
 ON 
 ONCE
 ONLY 
 OPEN
 OPENDATASOURCE  
 OPENQUERY  
 OPENROWSET
 OPTION 
 OR  
 ORDER
 OUTER
 OVER 
 PERCENT
 PERM
 PERMANENT
 PIPE 
 PLAN 
 PRECISION 
 PREPARE  
 PRIMARY 
 PRINT 
 PRIVILEGES
 PROC  
 PROCEDURE
 PROCESSEXIT
 PUBLIC 
 RAISERROR 
 READ  
 READTEXT 
 RECONFIGURE
 REFERENCES 
 REPEATABLE 
 REPLICATION 
 RESTORE  
 RESTRICT 
 RETURN 
 REVOKE  
 RIGHT  
 ROLLBACK 
 ROWCOUNT 
 ROWGUIDCOL 
 RULE 
 SAVE
 SCHEMA
 SELECT  
 SERIALIZABLE  
 SESSION_USER 
 SET 
 SETUSER 
 SHUTDOWN 
 SOME  
 STATISTICS  
 SUBSTR
 SUM 
 SYSTEM_USER 
 TABLE 
 TAPE 
 TEMP 
 TEMPORARY  
 TEXTSIZE 
 THEN  
 TIMESTAMP 
 TO 
 TOP 
 TRAN 
 TRANSACTION 
 TRIGGER
 TRUNCATE 
 TSEQUAL  
 UNCOMMITTED 
 UNION  
 UNIQUE
 UPDATE 
 UPDATETEXT
 USE  
 USER
 USING 
 VALUES 
 VARYING  
 WAITFOR 
 WHEN  
 WHERE 
 WHILE 
 WITH 
 WORK 
 WRITETEXT 
 ;MySQL Features  
 AUTO_INCREMENT

首先将以上代码复制,并且保存为【sql.stx】

将这个 sql.stx 文件拖曳进你的 editplus 软件安装目录中

打开 editplus 的“参数设置”菜单,打开后点击“添加”按钮

输入SQL

点击语法文件那一行的三个点,选中刚刚保存的【sql.stx】文件

添加好后,在【文件扩展名】一栏输入【sql】即可

还是不会的话可以看下面的0智商版图片

技术分享

让 Editplus 支持 SQL 语法高亮【提供参考方法,有更好的语法文件可以自己替换】