EditPlus不能著色顯示SQl語句的問題

[0]發表於2014-12-02

說明:今天重灌了系統後,從網上安裝下載了一個EditPlus閱讀程式碼,發現sql語句是灰色的,不和以前的帶有顏色的看著美觀了,頓時心裡彆扭了起來。以為下錯了版本,可是換了好幾個,都是這樣,網上查了一下,才知道缺少個著色的檔案。所以,我們手動新增一下這個sql著色的檔案就可以了。

解決方法:

(1)我們先看看是什麼檔案,起到了讓語法高亮的作用。

因為我的是英文版的,開啟editplus,開啟tools -> Preferences -> Files -> Setting &syntax

中文的話是:“工具”“首選項”“檔案”“設定和語法”

如圖:

01

02

03

(2)著色檔案的建立

在那個著色的資料夾裡,新建txt文件,開啟,複製貼上如下程式碼:

#TITLE=SQL
; SQL syntax file written by KK.

#DELIMITER=,(){}[]-+*%/="'~!&|<>?:;.
#QUOTATION1='
#QUOTATION2="
#LINECOMMENT=--
#COMMENTON=

#SPECIAL_STX=SQL

#KEYWORD=SQL Tags
;VAR
sql_variant
datetime
smalldatetime
float
real
decimal
money
smallmoney
bigint
int
smallint
tinyint
bit
ntext
text
image
integer
timestamp
uniqueidentifier
nvarchar
nchar
varchar
char
CHARACTER
varbinary
binary
#KEYWORD=Reserved words
ADD
ALL
ALTER
AND
ANY
AS
ASC
AUTHORIZATION
AVG
BACKUP
BEGIN
BETWEEN
BREAK
BROWSE
BULK
BY
CASCADE
CASE
CHECK
CHECKPOINT
CLOSE
CLUSTERED
COALESCE
COLUMN
COMMIT
COMMENT
COMMITTED
COMPUTE
CONFIRM
CONNECT
CONSTRAINT
CONTAINS
CONTAINSTABLE
CONTINUE
CONTROLROW
CONVERT
COUNT
CREATE
CROSS
CURRENT
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_USER
CURSOR
DATABASE
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
INDEX
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
VIEW
WAITFOR
WHEN
WHERE
WHILE
WITH
WORK
WRITETEXT

儲存,將檔名修改成sql.stx。然後

05

新增一個新的檔案型別。單擊右上角的add,新增一個型別,在description欄位填上sql,file Extensions欄位也填上sql,如果有多個副檔名,之間用“;”隔開(例如:sql;db2),然後在syntax file欄位填上sql.stx檔案所在的路徑,或者點選…按鈕,選擇你自己建立的sql著色檔案。對了,最後別忘了點選OK按鈕奧。

相關文章