dotfiles-pub/common/nano/syntax/sql.nanorc

52 lines
2.4 KiB
Text

syntax "SQL" "\.sql$" "sqliterc$"
icolor cyan "\<(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\>"
icolor cyan "\<(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\>"
icolor cyan "\<(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\>"
icolor cyan "\<(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\>"
icolor cyan "\<(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\>"
icolor cyan "\<(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\>"
icolor cyan "\<(GROUP|GRANT|HAVING)\>"
icolor cyan "\<(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\>"
icolor cyan "\<(JOIN|KEYS|KILL|KEY)\>"
icolor cyan "\<(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\>"
icolor cyan "\<(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\>"
icolor cyan "\<(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\>"
icolor cyan "\<(PROCEDURE|PROCEDURAL|PRIMARY)\>"
icolor cyan "\<(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\>"
icolor cyan "\<(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\>"
icolor cyan "\<(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\>"
icolor cyan "\<(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\>"
icolor cyan "\<(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\>"
color green "\<(VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\>"
# SQLite meta commands
icolor cyan "\.\<(databases|dump|echo|exit|explain|header(s)?|help)\>"
icolor cyan "\.\<(import|indices|mode|nullvalue|output|prompt|quit|read)\>"
icolor cyan "\.\<(schema|separator|show|tables|timeout|width)\>"
color brightcyan "\<(ON|OFF)\>"
color blue "\<([0-9]+)\>"
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
color yellow "`(\\.|[^\\`])*`"
color brightblack "\-\-.*$"
color ,red "[[:space:]]+$"
color ,red " + +| + +"
# rainbow indent
color ,brightblack "^[[:space:]]{32}"
color ,black "^[[:space:]]{30}"
color ,brightblack "^[[:space:]]{28}"
color ,black "^[[:space:]]{26}"
color ,brightblack "^[[:space:]]{24}"
color ,black "^[[:space:]]{22}"
color ,brightblack "^[[:space:]]{20}"
color ,black "^[[:space:]]{18}"
color ,brightblack "^[[:space:]]{16}"
color ,black "^[[:space:]]{14}"
color ,brightblack "^[[:space:]]{12}"
color ,black "^[[:space:]]{10}"
color ,brightblack "^[[:space:]]{8}"
color ,black "^[[:space:]]{6}"
color ,brightblack "^[[:space:]]{4}"
color ,black "^[[:space:]]{2}"