如何让 Editplus 支持 SQL 语法高亮

如何让 Editplus 支持 SQL 语法高亮,第1张

首先新建一个文本文档,并打开它

在打开的文档中添加如下内容:(内容较长,建议复制)

#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”,即对打开的扩展名为 sql 的文件进行高亮显示

此时我们再随便用 editplus 打开一个 sql 文件都可以看到语法高亮了

需要创建一份模版文件来保存sql的关键字等信息,然后导入。

新建一个txt文件,命名为“sql.stx”,右键编辑,然后粘贴:

#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

保存到想存放的位置(建议Editplus安装目录),然后打开 editplus 的“参数设置”菜单,打开后点击“添加”按钮,输入 SQL,并确定。

点击如图所示的“三个点”按钮来添加语法文件,也就是刚才我们拖曳进去的 sql.stx 文件:

添加好后,在“文件扩展名”一栏中输入“sql”,即对打开的扩展名为 sql 的文件进行高亮显示。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/11154020.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-14
下一篇 2023-05-14

发表评论

登录后才能评论

评论列表(0条)

保存