Add syntax flags and fix a couple highlighting bugs
This commit is contained in:
parent
96254717c6
commit
b8f6850c58
50 changed files with 204 additions and 185 deletions
|
@ -137,7 +137,7 @@ func Match(rules string, buf *Buffer, v *View) map[int]tcell.Style {
|
|||
|
||||
lines := strings.Split(rules, "\n")
|
||||
m := make(map[int]tcell.Style)
|
||||
parser := regexp.MustCompile(`color (.*?)\s+"(.*)"`)
|
||||
parser := regexp.MustCompile(`color (.*?)\s+(?:\((.*?)\)\s+)?"(.*)"`)
|
||||
for _, line := range lines {
|
||||
if strings.TrimSpace(line) == "" {
|
||||
// Ignore this line
|
||||
|
@ -145,7 +145,13 @@ func Match(rules string, buf *Buffer, v *View) map[int]tcell.Style {
|
|||
}
|
||||
submatch := parser.FindSubmatch([]byte(line))
|
||||
color := string(submatch[1])
|
||||
regex, err := regexp.Compile(string(submatch[2]))
|
||||
var regexStr string
|
||||
if len(submatch) == 4 {
|
||||
regexStr = "(?m" + string(submatch[2]) + ")" + string(submatch[3])
|
||||
} else if len(submatch) == 3 {
|
||||
regexStr = "(?m)" + string(submatch[2])
|
||||
}
|
||||
regex, err := regexp.Compile(regexStr)
|
||||
if err != nil {
|
||||
// Error with the regex!
|
||||
continue
|
||||
|
@ -157,22 +163,9 @@ func Match(rules string, buf *Buffer, v *View) map[int]tcell.Style {
|
|||
for _, value := range indicies {
|
||||
value[0] += startNum
|
||||
value[1] += startNum
|
||||
for i := value[0] + 1; i < value[1]; i++ {
|
||||
if _, exists := m[i]; exists {
|
||||
delete(m, i)
|
||||
}
|
||||
}
|
||||
|
||||
if value[0] < toplineNum && value[1] > toplineNum {
|
||||
m[toplineNum] = st
|
||||
}
|
||||
|
||||
if value[0] >= toplineNum {
|
||||
m[value[0]] = st
|
||||
}
|
||||
if value[1] >= toplineNum {
|
||||
if _, exists := m[value[1]]; !exists {
|
||||
m[value[1]] = tcell.StyleDefault
|
||||
for i := value[0]; i < value[1]; i++ {
|
||||
if i >= toplineNum {
|
||||
m[i] = st
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
const (
|
||||
tabSize = 4
|
||||
synLinesUp = 100
|
||||
synLinesDown = 100
|
||||
synLinesUp = 75
|
||||
synLinesDown = 75
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -342,6 +342,8 @@ func (v *View) Display() {
|
|||
st, ok := v.matches[charNum]
|
||||
if ok {
|
||||
highlightStyle = st
|
||||
} else {
|
||||
highlightStyle = tcell.StyleDefault
|
||||
}
|
||||
|
||||
if v.cursor.HasSelection() &&
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
syntax "Dockerfile" "Dockerfile[^/]*$" "\.dockerfile$"
|
||||
|
||||
## Keywords
|
||||
icolor red "^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD)[[:space:]]"
|
||||
red (i) "^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD)[[:space:]]"
|
||||
|
||||
## Brackets & parenthesis
|
||||
color brightgreen "(\(|\)|\[|\])"
|
||||
|
@ -11,7 +11,7 @@ color brightgreen "(\(|\)|\[|\])"
|
|||
color brightmagenta "&&"
|
||||
|
||||
## Comments
|
||||
icolor cyan "^[[:space:]]*#.*$"
|
||||
cyan (i) "^[[:space:]]*#.*$"
|
||||
|
||||
## Blank space at EOL
|
||||
color ,green "[[:space:]]+$"
|
||||
|
|
|
@ -6,5 +6,5 @@ put them all in `~/.micro/syntax`.
|
|||
They are taken from Nano, specifically from [this repository](https://github.com/scopatz/nanorc).
|
||||
Micro syntax files are almost identical to Nano's, except for some key differences:
|
||||
|
||||
* Micro does not use `icolor`. Instead use the case insensitive flag (`(?i)`) in the regular expression
|
||||
* Micro does not support `start="..." end="..."`, instead use the multiline match flag (`(?s)`) and put `.*?` in the middle
|
||||
* Micro does not use `. Instead (i) use the case insensitive flag (`(i)`) in the regular expression
|
||||
* Micro does not support `start="..." end="..."`, instead use the multiline match flag (`(s)`) and put `.*?` in the middle
|
||||
|
|
|
@ -35,22 +35,22 @@ color brightred "\b[A-Z_][0-9A-Z_]+\b"
|
|||
color green "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
|
||||
|
||||
## Constants
|
||||
icolor green "\b(HIGH|LOW|INPUT|OUTPUT)\b"
|
||||
green (i) "\b(HIGH|LOW|INPUT|OUTPUT)\b"
|
||||
|
||||
## Serial Print
|
||||
icolor red "\b(DEC|BIN|HEX|OCT|BYTE)\b"
|
||||
red (i) "\b(DEC|BIN|HEX|OCT|BYTE)\b"
|
||||
|
||||
## PI Constants
|
||||
icolor green "\b(PI|HALF_PI|TWO_PI)\b"
|
||||
green (i) "\b(PI|HALF_PI|TWO_PI)\b"
|
||||
|
||||
## ShiftOut
|
||||
icolor green "\b(LSBFIRST|MSBFIRST)\b"
|
||||
green (i) "\b(LSBFIRST|MSBFIRST)\b"
|
||||
|
||||
## Attach Interrupt
|
||||
icolor green "\b(CHANGE|FALLING|RISING)\b"
|
||||
green (i) "\b(CHANGE|FALLING|RISING)\b"
|
||||
|
||||
## Analog Reference
|
||||
icolor green "\b(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\b"
|
||||
green (i) "\b(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\b"
|
||||
|
||||
## === FUNCTIONS === ##
|
||||
|
||||
|
@ -106,11 +106,11 @@ color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidd
|
|||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||
|
||||
## This string is VERY resource intensive!
|
||||
color brightyellow "(?s)"(\\.|[^"])*\\[[:space:]]*$.*?^(\\.|[^"])*""
|
||||
color brightyellow (s) ""(\\.|[^"])*\\[[:space:]]*$.*?^(\\.|[^"])*""
|
||||
|
||||
## Comments
|
||||
color brightblue "//.*"
|
||||
color brightblue "(?s)/\*.*?\*/"
|
||||
color brightblue (s) "/\*.*?\*/"
|
||||
|
||||
## Trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
||||
|
|
|
@ -5,13 +5,14 @@ color red "\b[A-Z_]{2,}\b"
|
|||
color brightgreen "\.(data|subsection|text)"
|
||||
color green "\.(align|file|globl|global|hidden|section|size|type|weak)"
|
||||
color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)"
|
||||
icolor brightred "^[[:space:]]*[.0-9A-Z_]*:"
|
||||
brightred (i) "^[[:space:]]*[.0-9A-Z_]*:"
|
||||
color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
|
||||
## Highlight strings (note: VERY resource intensive)
|
||||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||
color brightyellow "(?s)"(\\.|[^"])*\\[[:space:]]*$.*?^(\\.|[^"])*""
|
||||
color brightyellow (s) ""(\\.|[^"])*\\[[:space:]]*$.*?^(\\.|[^"])*""
|
||||
## Highlight comments
|
||||
color brightblue "//.*"
|
||||
color brightblue "(?s)/\*.*?\*/"
|
||||
color brightblue (s) "/\*.*?\*/"
|
||||
## Highlight trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
||||
|
||||
|
|
|
@ -29,11 +29,11 @@ color magenta "[(){}]" "\[" "\]"
|
|||
color cyan ""(\\.|[^"])*""
|
||||
##
|
||||
## This string is VERY resource intensive!
|
||||
#color cyan "(?s)"(\\.|[^"])*\\[[:space:]]*$.*?^(\\.|[^"])*""
|
||||
#color cyan (s) ""(\\.|[^"])*\\[[:space:]]*$.*?^(\\.|[^"])*""
|
||||
|
||||
## Comment highlighting
|
||||
color brightblue "//.*"
|
||||
color brightblue "(?s)/\*.*?\*/"
|
||||
color brightblue (s) "/\*.*?\*/"
|
||||
|
||||
## Trailing whitespace
|
||||
#color ,green "[[:space:]]+$"
|
||||
|
|
|
@ -2,21 +2,22 @@
|
|||
##
|
||||
syntax "CMake" "(CMakeLists\.txt|\.cmake)$"
|
||||
|
||||
icolor green "^[[:space:]]*[A-Z0-9_]+"
|
||||
icolor brightyellow "^[[:space:]]*(include|include_directories|include_external_msproject)\b"
|
||||
green (i) "^[[:space:]]*[A-Z0-9_]+"
|
||||
brightyellow (i) "^[[:space:]]*(include|include_directories|include_external_msproject)\b"
|
||||
|
||||
icolor brightgreen "^[[:space:]]*\b((else|end)?if|else|(end)?while|(end)?foreach|break)\b"
|
||||
brightgreen (i) "^[[:space:]]*\b((else|end)?if|else|(end)?while|(end)?foreach|break)\b"
|
||||
color brightgreen "\b(COPY|NOT|COMMAND|PROPERTY|POLICY|TARGET|EXISTS|IS_(DIRECTORY|ABSOLUTE)|DEFINED)\b[[:space:]]"
|
||||
color brightgreen "[[:space:]]\b(OR|AND|IS_NEWER_THAN|MATCHES|(STR|VERSION_)?(LESS|GREATER|EQUAL))\b[[:space:]]"
|
||||
|
||||
icolor brightred "^[[:space:]]*\b((end)?(function|macro)|return)"
|
||||
brightred (i) "^[[:space:]]*\b((end)?(function|macro)|return)"
|
||||
|
||||
#String Color
|
||||
color cyan "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
|
||||
color cyan "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
|
||||
|
||||
icolor brightred "(?s)\$(\{|ENV\{).*?\}"
|
||||
brightred (is) "\$(\{|ENV\{).*?\}"
|
||||
color magenta "\b(APPLE|UNIX|WIN32|CYGWIN|BORLAND|MINGW|MSVC(_IDE|60|71|80|90)?)\b"
|
||||
|
||||
icolor brightblue "^([[:space:]]*)?#.*"
|
||||
icolor brightblue "[[:space:]]#.*"
|
||||
brightblue (i) "^([[:space:]]*)?#.*"
|
||||
brightblue (i) "[[:space:]]#.*"
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
syntax "Conf" "\.c[o]?nf$"
|
||||
## Possible errors and parameters
|
||||
## Strings
|
||||
icolor white ""(\\.|[^"])*""
|
||||
white (i) ""(\\.|[^"])*""
|
||||
## Comments
|
||||
icolor brightblue "^[[:space:]]*#.*$"
|
||||
icolor cyan "^[[:space:]]*##.*$"
|
||||
brightblue (i) "^[[:space:]]*#.*$"
|
||||
cyan (i) "^[[:space:]]*##.*$"
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
|||
color magenta "\\([btnfr]|'|\"|\\)"
|
||||
color magenta "\\u[A-Fa-f0-9]{4}"
|
||||
color brightblack "(^|[[:space:]])//.*"
|
||||
color brightblack "(?s)/\*.*?\*/"
|
||||
color brightblack (s) "/\*.*?\*/"
|
||||
color brightwhite,cyan "TODO:?"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
|
||||
syntax "CSS" "\.(css|scss)$"
|
||||
color brightred "."
|
||||
color brightyellow "(?s)\{.*?\}"
|
||||
color brightwhite "(?s):.*?[;^\{]"
|
||||
color brightyellow (s) "\{.*?\}"
|
||||
color brightwhite (s) ":.*?[;^\{]"
|
||||
color brightblue ":active|:focus|:hover|:link|:visited|:link|:after|:before|$"
|
||||
color brightblue "(?s)\/\*.*?\*\/"
|
||||
color brightblue (s) "\/\*.*?\*\/"
|
||||
color green ";|:|\{|\}"
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
## Cython nanorc, based off of Python nanorc.
|
||||
##
|
||||
syntax "Cython" "\.pyx$" "\.pxd$" "\.pyi$"
|
||||
icolor brightred "def [ 0-9A-Z_]+"
|
||||
icolor brightred "cpdef [0-9A-Z_]+\(.*\):"
|
||||
icolor brightred "cdef cppclass [ 0-9A-Z_]+\(.*\):"
|
||||
brightred (i) "def [ 0-9A-Z_]+"
|
||||
brightred (i) "cpdef [0-9A-Z_]+\(.*\):"
|
||||
brightred (i) "cdef cppclass [ 0-9A-Z_]+\(.*\):"
|
||||
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ color magenta "[(){}]" "\[" "\]"
|
|||
#String Color
|
||||
color cyan "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
|
||||
color cyan "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
|
||||
color cyan "(?s)"""[^"].*?"""" "(?s)'''[^'].*?'''"
|
||||
color cyan (s) """"[^"].*?"""" (s) "'''[^'].*?'''"
|
||||
|
||||
# Comment Color
|
||||
color brightblue "#.*$"
|
||||
|
|
|
@ -69,7 +69,7 @@ color magenta "\\s *#\\s *"
|
|||
color yellow ""(\\.|[^"])*""
|
||||
|
||||
### WysiwygString
|
||||
color yellow "(?s)r".*?""
|
||||
color yellow (s) "r".*?""
|
||||
color yellow "`[^`]*`"
|
||||
|
||||
### HexString
|
||||
|
@ -80,20 +80,20 @@ color yellow "q"\(.*\)""
|
|||
color yellow "q"\{.*\}""
|
||||
color yellow "q"\[.*\]""
|
||||
color yellow "q"<.*>""
|
||||
color yellow "(?s)q"[^({[<"][^"]*$.*?^[^"]+""
|
||||
color yellow (s) "q"[^({[<"][^"]*$.*?^[^"]+""
|
||||
color yellow "q"([^({[<"]).*\1""
|
||||
|
||||
### TokenString
|
||||
### True token strings require nesting, so, again, they can't be implemented accurately here.
|
||||
### At the same time, the intended purpose of token strings makes it questionable to highlight them as strings at all.
|
||||
## color ,magenta "(?s)q\{.*?\}"
|
||||
## color ,magenta (s) "q\{.*?\}"
|
||||
|
||||
## Comments
|
||||
## NB: true nested comments are impossible to implement with plain regex
|
||||
color brightblack "//.*"
|
||||
color brightblack "(?s)/\*.*?\*/"
|
||||
color brightblack "(?s)/\+.*?\+/"
|
||||
color brightblack (s) "/\*.*?\*/"
|
||||
color brightblack (s) "/\+.*?\+/"
|
||||
|
||||
## Trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,green "^[[:space:]]+$"
|
||||
|
||||
|
|
|
@ -5,4 +5,5 @@ color magenta "\b(arrowhead|arrowsize|arrowtail|bgcolor|center|color|constraint|
|
|||
color red "=|->|--"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightblack "(^|[[:space:]])//.*"
|
||||
color brightblack "(?s)/\*.*?\*/"
|
||||
color brightblack (s) "/\*.*?\*/"
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
## https://github.com/geomic/ERB-And-More-Code-Highlighting-for-nano
|
||||
|
||||
syntax "ERB" "\.erb$" "\.rhtml$"
|
||||
color blue "(?s)<.*?>"
|
||||
color white "(?s)<%.*?%>"
|
||||
color blue (s) "<.*?>"
|
||||
color white (s) "<%.*?%>"
|
||||
color red "&[^;[[:space:]]]*;"
|
||||
color yellow "\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\b"
|
||||
color brightblue "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*"
|
||||
icolor magenta "([ ]|^):[0-9A-Z_]+\b"
|
||||
magenta (i) "([ ]|^):[0-9A-Z_]+\b"
|
||||
color brightyellow "\b(__FILE__|__LINE__)\b"
|
||||
color brightmagenta "!/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
|
||||
color brightblue "`[^`]*`" "%x\{[^}]*\}"
|
||||
|
@ -19,6 +19,7 @@ color brightgreen "#\{[^}]*\}"
|
|||
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||
color cyan "#[^{].*$" "#$"
|
||||
color brightcyan "##[^{].*$" "##$"
|
||||
color green "(?s)<<-?'?EOT'?.*?^EOT"
|
||||
color green (s) "<<-?'?EOT'?.*?^EOT"
|
||||
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
## Here is an example for Fish shell scripts.
|
||||
##
|
||||
syntax "Fish" "\.fish$"
|
||||
icolor brightgreen "^[0-9A-Z_]+\(\)"
|
||||
brightgreen (i) "^[0-9A-Z_]+\(\)"
|
||||
color green "\b(alias|begin|break|case|continue|contains|else|end|for|function|if|math|return|set|switch|test|while)\b"
|
||||
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||
color green "\b(and|isatty|not|or|in)\b"
|
||||
color yellow "--[a-z-]+"
|
||||
color brightmagenta "\ -[a-z]+"
|
||||
color brightblue "\b(bg|bind|block|breakpoint|builtin|cd|command|commandline|complete|dirh|dirs|echo|emit|eval|exec|exit|fg|fish|fish_config|fish_ident|fish_pager|fish_prompt|fish_right_prompt|fish_update_completions|fishd|funced|funcsave|functions|help|history|jobs|mimedb|nextd|open|popd|prevd|psub|pushd|pwd|random|read|set_color|status|trap|type|ulimit|umask|vared)\b"
|
||||
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
brightred (i) "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
color cyan "(^|[[:space:]])#.*$"
|
||||
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
||||
color ,green "[[:space:]]+$"
|
||||
|
|
|
@ -5,33 +5,33 @@ syntax "Fortran" "\.([Ff]|[Ff]90|[Ff]95|[Ff][Oo][Rr])$"
|
|||
#color red "\b[A-Z_]a[0-9A-Z_]+\b"
|
||||
color red "\b[0-9]+\b"
|
||||
|
||||
icolor green "\b(action|advance|all|allocatable|allocated|any|apostrophe)\b"
|
||||
icolor green "\b(append|asis|assign|assignment|associated|character|common)\b"
|
||||
icolor green "\b(complex|data|default|delim|dimension|double precision)\b"
|
||||
icolor green "\b(elemental|epsilon|external|file|fmt|form|format|huge)\b"
|
||||
icolor green "\b(implicit|include|index|inquire|integer|intent|interface)\b"
|
||||
icolor green "\b(intrinsic|iostat|kind|logical|module|none|null|only)\b"
|
||||
icolor green "\b(operator|optional|pack|parameter|pointer|position|private)\b"
|
||||
icolor green "\b(program|public|real|recl|recursive|selected_int_kind)\b"
|
||||
icolor green "\b(selected_real_kind|subroutine|status)\b"
|
||||
green (i) "\b(action|advance|all|allocatable|allocated|any|apostrophe)\b"
|
||||
green (i) "\b(append|asis|assign|assignment|associated|character|common)\b"
|
||||
green (i) "\b(complex|data|default|delim|dimension|double precision)\b"
|
||||
green (i) "\b(elemental|epsilon|external|file|fmt|form|format|huge)\b"
|
||||
green (i) "\b(implicit|include|index|inquire|integer|intent|interface)\b"
|
||||
green (i) "\b(intrinsic|iostat|kind|logical|module|none|null|only)\b"
|
||||
green (i) "\b(operator|optional|pack|parameter|pointer|position|private)\b"
|
||||
green (i) "\b(program|public|real|recl|recursive|selected_int_kind)\b"
|
||||
green (i) "\b(selected_real_kind|subroutine|status)\b"
|
||||
|
||||
icolor cyan "\b(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\b"
|
||||
icolor cyan "\b(close|contains|count|cpu_time|cshift|date_and_time)\b"
|
||||
icolor cyan "\b(deallocate|digits|dot_product|eor|eoshift|function|iachar)\b"
|
||||
icolor cyan "\b(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\b"
|
||||
icolor cyan "\b(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\b"
|
||||
icolor cyan "\b(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\b"
|
||||
icolor cyan "\b(open|pad|present|print|product|pure|quote|radix)\b"
|
||||
icolor cyan "\b(random_number|random_seed|range|read|readwrite|replace)\b"
|
||||
icolor cyan "\b(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\b"
|
||||
icolor cyan "\b(spread|sum|system_clock|target|transfer|transpose|trim)\b"
|
||||
icolor cyan "\b(ubound|unpack|verify|write|tiny|type|use|yes)\b"
|
||||
cyan (i) "\b(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\b"
|
||||
cyan (i) "\b(close|contains|count|cpu_time|cshift|date_and_time)\b"
|
||||
cyan (i) "\b(deallocate|digits|dot_product|eor|eoshift|function|iachar)\b"
|
||||
cyan (i) "\b(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\b"
|
||||
cyan (i) "\b(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\b"
|
||||
cyan (i) "\b(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\b"
|
||||
cyan (i) "\b(open|pad|present|print|product|pure|quote|radix)\b"
|
||||
cyan (i) "\b(random_number|random_seed|range|read|readwrite|replace)\b"
|
||||
cyan (i) "\b(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\b"
|
||||
cyan (i) "\b(spread|sum|system_clock|target|transfer|transpose|trim)\b"
|
||||
cyan (i) "\b(ubound|unpack|verify|write|tiny|type|use|yes)\b"
|
||||
|
||||
icolor yellow "\b(.and.|case|do|else|else?if|else?where|end|end?do|end?if)\b"
|
||||
icolor yellow "\b(end?select|.eqv.|forall|if|lge|lgt|lle|llt|.neqv.|.not.)\b"
|
||||
icolor yellow "\b(.or.|repeat|select case|then|where|while)\b"
|
||||
yellow (i) "\b(.and.|case|do|else|else?if|else?where|end|end?do|end?if)\b"
|
||||
yellow (i) "\b(end?select|.eqv.|forall|if|lge|lgt|lle|llt|.neqv.|.not.)\b"
|
||||
yellow (i) "\b(.or.|repeat|select case|then|where|while)\b"
|
||||
|
||||
icolor magenta "\b(continue|cycle|exit|go?to|result|return)\b"
|
||||
magenta (i) "\b(continue|cycle|exit|go?to|result|return)\b"
|
||||
|
||||
#Operator Color
|
||||
color yellow "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
|
||||
|
@ -43,8 +43,9 @@ color magenta "[(){}]" "\[" "\]"
|
|||
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
||||
|
||||
## String highlighting.
|
||||
icolor cyan "<[^= ]*>" ""(\\.|[^"])*""
|
||||
icolor cyan "<[^= ]*>" "'(\\.|[^"])*'"
|
||||
cyan (i) "<[^= ]*>" ""(\\.|[^"])*""
|
||||
cyan (i) "<[^= ]*>" "'(\\.|[^"])*'"
|
||||
|
||||
## Comment highlighting
|
||||
icolor brightred "!.*$" "(^[Cc]| [Cc]) .*$"
|
||||
brightred (i) "!.*$" "(^[Cc]| [Cc]) .*$"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ color brightcyan "\b(true|false)\b"
|
|||
color red "[-+/*=<>?:!~%&|^]"
|
||||
color blue "\b([0-9]+|0x[0-9a-fA-F]*)\b"
|
||||
color brightblack "(^|[[:space:]])//.*"
|
||||
color brightblack "(?s)/\*.*?\*/"
|
||||
color brightblack (s) "/\*.*?\*/"
|
||||
color brightwhite,cyan "TODO:?"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
|
@ -16,7 +16,7 @@ color magenta "\\[abfnrtv'\"\\]"
|
|||
color magenta "\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
||||
color yellow "`[^`]*`"
|
||||
color brightblack "(^|[[:space:]])//.*"
|
||||
color green "(?s)/\*.*?\*/"
|
||||
color green (s) "/\*.*?\*/"
|
||||
color brightwhite,cyan "TODO:?"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
|
@ -9,16 +9,17 @@ color brightmagenta "\\."
|
|||
color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]"
|
||||
## Newlines
|
||||
color cyan "(\\|\\\\)n(.|\(..)"
|
||||
color cyan "(?s)(\\|\\\\)n\[.*?]"
|
||||
color cyan (s) "(\\|\\\\)n\[.*?]"
|
||||
## Requests
|
||||
color brightgreen "^\.[[:space:]]*[^[[:space:]]]*"
|
||||
## Comments
|
||||
color yellow "^\.\\".*$"
|
||||
## Strings
|
||||
color green "(\\|\\\\)\*(.|\(..)"
|
||||
color green "(?s)(\\|\\\\)\*\[.*?]"
|
||||
color green (s) "(\\|\\\\)\*\[.*?]"
|
||||
## Characters
|
||||
color brightred "\\\(.."
|
||||
color brightred "(?s)\\\[.*?]"
|
||||
color brightred (s) "\\\[.*?]"
|
||||
## Macro arguments
|
||||
color brightcyan "\\\\\$[1-9]"
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ syntax "Haml" "\.haml$"
|
|||
|
||||
color cyan "-|="
|
||||
color white "->|=>"
|
||||
icolor cyan "([ ]|^)%[0-9A-Z_]+\b"
|
||||
icolor magenta ":[0-9A-Z_]+\b"
|
||||
icolor yellow "\.[A-Z_]+\b"
|
||||
cyan (i) "([ ]|^)%[0-9A-Z_]+\b"
|
||||
magenta (i) ":[0-9A-Z_]+\b"
|
||||
yellow (i) "\.[A-Z_]+\b"
|
||||
## Double quote & single quote
|
||||
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
|
||||
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||
|
|
|
@ -26,6 +26,7 @@ color yellow ""[^\"]*""
|
|||
|
||||
## Comments
|
||||
color green "--.*"
|
||||
color green "(?s)\{-.*?-\}"
|
||||
color green (s) "\{-.*?-\}"
|
||||
|
||||
color brightred "undefined"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Here is a short improved example for HTML.
|
||||
##
|
||||
syntax "HTML" "\.htm[l]?$"
|
||||
color brightblue "(?s)<.*?>"
|
||||
color brightblue (s) "<.*?>"
|
||||
color red "&[^;[[:space:]]]*;"
|
||||
color yellow ""[^"]*"|qq\|.*\|"
|
||||
color red "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
|
||||
|
|
|
@ -7,6 +7,7 @@ color cyan "\b(abstract|class|extends|final|implements|import|instanceof|interfa
|
|||
color red ""[^"]*""
|
||||
color yellow "\b(true|false|null)\b"
|
||||
color blue "//.*"
|
||||
color blue "(?s)/\*.*?\*/"
|
||||
color brightblue "(?s)/\*\*.*?\*/"
|
||||
color blue (s) "/\*.*?\*/"
|
||||
color brightblue (s) "/\*\*.*?\*/"
|
||||
color ,green "[[:space:]]+$"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
## Old version
|
||||
|
||||
#syntax "JavaScript" "(\.|/|)js$"
|
||||
#color green "//.*$" "(?s)\/\*.*?\*\/"
|
||||
#color green "//.*$" (s) "\/\*.*?\*\/"
|
||||
#color blue "'(\\.|[^'])*'"
|
||||
#color red ""(\\.|[^\"])*""
|
||||
#color brightgreen "\b(true)\b"
|
||||
|
@ -42,5 +42,6 @@ color brightyellow "L?'(\'|[^'])*'"
|
|||
color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
|
||||
|
||||
## Comments
|
||||
color brightblue "(?s)/\*.*?\*/"
|
||||
color brightblue (s) "/\*.*?\*/"
|
||||
color brightblue "//.*$"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ syntax "Lisp" "(emacs|zile)$" "\.(el|li?sp|scm|ss)$"
|
|||
color brightblue "\([a-z-]+"
|
||||
color red "\(([-+*/<>]|<=|>=)|'"
|
||||
color blue "\b[0-9]+\b"
|
||||
icolor cyan "\bnil\b"
|
||||
cyan (i) "\bnil\b"
|
||||
color brightcyan "\b[tT]\b"
|
||||
color yellow "\"(\\.|[^"])*\""
|
||||
color magenta "'[A-Za-z][A-Za-z0-9_-]+"
|
||||
|
|
|
@ -58,7 +58,7 @@ color brightmagenta "(\(|\)|\[|\]|\{|\})"
|
|||
color red "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
|
||||
|
||||
# Multiline strings
|
||||
color red "(?s)\s*\[\[.*?\]\]"
|
||||
color red (s) "\s*\[\[.*?\]\]"
|
||||
|
||||
# Escapes
|
||||
color red "\\[0-7][0-7][0-7]|\\x[0-9a-fA-F][0-9a-fA-F]|\\[abefnrs]|(\\c|\\C-|\\M-|\\M-\\C-)."
|
||||
|
@ -70,4 +70,5 @@ color brightcyan "^#!.*"
|
|||
color green "\-\-.*$"
|
||||
|
||||
# Multiline comments
|
||||
color green "(?s)\s*\-\-\s*\[\[.*?\]\]"
|
||||
color green (s) "\s*\-\-\s*\[\[.*?\]\]"
|
||||
|
||||
|
|
|
@ -41,7 +41,8 @@ color magenta "!\[[^][]*\](\([^)]+\)|\[[^]]+\])"
|
|||
color brightyellow "https?://[^ )>]+"
|
||||
|
||||
# code
|
||||
color yellow "`[^`]*`|^ {4}[^-+*].*"
|
||||
color yellow "`.*?`|^ {4}[^-+*].*"
|
||||
# code blocks
|
||||
color yellow "(?s)^```[^$].*?^```$"
|
||||
# color yellow (s) "^```[^$].*?^```$"
|
||||
color yellow "^```$"
|
||||
|
||||
|
|
|
@ -2,15 +2,16 @@
|
|||
##
|
||||
syntax "Nanorc" "\.?nanorc$"
|
||||
## Possible errors and parameters
|
||||
icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
|
||||
brightwhite (i) "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
|
||||
## Keywords
|
||||
icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|preserve|punct)\b" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds)\b"
|
||||
icolor green "^[[:space:]]*(set|unset|include|syntax|header)\b"
|
||||
brightgreen (i) "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|preserve|punct)\b" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds)\b"
|
||||
green (i) "^[[:space:]]*(set|unset|include|syntax|header)\b"
|
||||
## Colors
|
||||
icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\b"
|
||||
icolor magenta "^[[:space:]]*i?color\b" "\b(start|end)="
|
||||
yellow (i) "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\b"
|
||||
magenta (i) "^[[:space:]]*i?color\b" "\b(start|end)="
|
||||
## Strings
|
||||
icolor white ""(\\.|[^"])*""
|
||||
white (i) ""(\\.|[^"])*""
|
||||
## Comments
|
||||
icolor brightblue "^[[:space:]]*#.*$"
|
||||
icolor cyan "^[[:space:]]*##.*$"
|
||||
brightblue (i) "^[[:space:]]*#.*$"
|
||||
cyan (i) "^[[:space:]]*##.*$"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ color brightcyan "\b(on|off)\b"
|
|||
color brightyellow "\$[A-Za-z][A-Za-z0-9_]*"
|
||||
color red "[*]"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color yellow "(?s)'$.*?';$"
|
||||
color yellow (s) "'$.*?';$"
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
|
@ -20,6 +20,7 @@ color green "\b(include|inherit|initializer)\b"
|
|||
#expr modifiers
|
||||
color yellow "\b(new|ref|mutable|lazy|assert|raise)\b"
|
||||
#comments
|
||||
color white "(?s)\(\*.*?\*\)"
|
||||
color white (s) "\(\*.*?\*\)"
|
||||
#strings (no multiline handling yet)
|
||||
color brightblack ""[^\"]*""
|
||||
|
||||
|
|
|
@ -5,9 +5,10 @@ header "^#!.*/(env +)?perl( |$)"
|
|||
|
||||
color red "\b(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\b" "\b(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\b" "\b(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\b" "\b(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\b" "\b(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\b"
|
||||
color magenta "\b(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\b"
|
||||
icolor cyan "(?s)[$@%].*?( |[^0-9A-Z_]|-)"
|
||||
cyan (is) "[$@%].*?( |[^0-9A-Z_]|-)"
|
||||
color yellow "".*"|qq\|.*\|"
|
||||
color white "[sm]/.*/"
|
||||
color white "(?s)(^use| = new).*?;"
|
||||
color white (s) "(^use| = new).*?;"
|
||||
color green "#.*"
|
||||
color yellow "(?s)<< 'STOP'.*?STOP"
|
||||
color yellow (s) "<< 'STOP'.*?STOP"
|
||||
|
||||
|
|
|
@ -8,9 +8,10 @@ color brightblue "\b(continue|else|elsif|do|for|foreach|if|unless|until|while|eq
|
|||
|
||||
# Perl 6 words
|
||||
color brightcyan "\b(has|is|class|role|given|when|BUILD|multi|returns|method|submethod|slurp|say|sub)\b"
|
||||
color brightmagenta "(?s)[$@%].*?( |\\W|-)"
|
||||
color brightmagenta (s) "[$@%].*?( |\\W|-)"
|
||||
color brightred "".*"|qq\|.*\|"
|
||||
color white "[sm]/.*/"
|
||||
color brightblue "(?s)(^use| = new).*?;"
|
||||
color brightblue (s) "(^use| = new).*?;"
|
||||
color brightgreen "#.*"
|
||||
color brightred "(?s)<<EOSQL.*?EOSQL"
|
||||
color brightred (s) "<<EOSQL.*?EOSQL"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
## PHP Syntax Highlighting
|
||||
syntax "PHP" "\.php[2345s~]?$"
|
||||
color white "(?s)<\?(php|=)?.*?\?>"
|
||||
color white (s) "<\?(php|=)?.*?\?>"
|
||||
# Functions
|
||||
color brightblue "([a-zA-Z0-9_-]*)\("
|
||||
# Constructs
|
||||
|
@ -33,8 +33,9 @@ color white "\{\$[^}]*\}"
|
|||
# PHP Tags
|
||||
color red "(<\?(php)?|\?>)"
|
||||
# General HTML
|
||||
color red "(?s)\?>.*?<\?(php|=)?"
|
||||
color red (s) "\?>.*?<\?(php|=)?"
|
||||
# trailing whitespace
|
||||
color ,green "[^[:space:]]{1}[[:space:]]+$"
|
||||
# multi-line comments
|
||||
color brightyellow "(?s)/\*.*?\*/"
|
||||
color brightyellow (s) "/\*.*?\*/"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Arch PKGBUILD files
|
||||
##
|
||||
syntax "PKGBUILD" "^.*PKGBUILD$"
|
||||
color green "(?s)^..*?$"
|
||||
color green (s) "^..*?$"
|
||||
color cyan "^.*(pkgbase|pkgname|pkgver|pkgrel|pkgdesc|arch|url|license).*=.*$"
|
||||
color brightcyan "\b(pkgbase|pkgname|pkgver|pkgrel|pkgdesc|arch|url|license)\b"
|
||||
color brightcyan "(\$|\$\{|\$\()(pkgbase|pkgname|pkgver|pkgrel|pkgdesc|arch|url|license)(\}|\))"
|
||||
|
|
|
@ -12,4 +12,5 @@ color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
|||
color brightmagenta "\b(union|group|subgroup)\b"
|
||||
## Comment highlighting
|
||||
color brightblue "//.*"
|
||||
color brightblue "(?s)/\*.*?\*/"
|
||||
color brightblue (s) "/\*.*?\*/"
|
||||
|
||||
|
|
|
@ -40,9 +40,10 @@ color yellow "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
|
|||
color green "#.*$"
|
||||
|
||||
## block comments
|
||||
color green "(?s)"""([^"]|$).*?"""" "(?s)'''([^']|$).*?'''"
|
||||
#color cyan "(?s)"""[^"].*?"""" "(?s)'''[^'].*?'''"
|
||||
#color cyan "(?s)([[:space:]]"""|^""").*?"""" "(?s)'''[^'].*?'''"
|
||||
#color cyan "(?s)""".*?"""" "(?s)'''.*?'''"
|
||||
#color cyan "(?s)("""[^"]|[^"]""").*?("""[^"]|[^"]""")" "(?s)'''[^'].*?'''"
|
||||
#color cyan "(?s)\"\"\".*?\"\"\""
|
||||
color green (s) """"([^"]|$).*?"""" (s) "'''([^']|$).*?'''"
|
||||
#color cyan (s) """"[^"].*?"""" (s) "'''[^'].*?'''"
|
||||
#color cyan (s) "([[:space:]]"""|^""").*?"""" (s) "'''[^'].*?'''"
|
||||
#color cyan (s) """".*?"""" (s) "'''.*?'''"
|
||||
#color cyan (s) "("""[^"]|[^"]""").*?("""[^"]|[^"]""")" (s) "'''[^'].*?'''"
|
||||
#color cyan (s) "\"\"\".*?\"\"\""
|
||||
|
||||
|
|
|
@ -7,14 +7,14 @@ color cyan "\b(Epoch|Serial|Nosource|Nopatch):"
|
|||
color cyan "\b(AutoReq|AutoProv|AutoReqProv):"
|
||||
color cyan "\b(Copyright|License|Summary|Summary\(.*\)|Distribution|Vendor|Packager|Group|Source[0-9]*|Patch[0-9]*|BuildRoot|Prefix):"
|
||||
color cyan "\b(Name|Version|Release|Url|URL):"
|
||||
color cyan "(?s)^(Source|Patch).*?:"
|
||||
color cyan (s) "^(Source|Patch).*?:"
|
||||
color cyan "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)"
|
||||
color cyan "(ifarch|ifnarch|ifos|ifnos)"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightyellow "%(if|else|endif|define|global|undefine)"
|
||||
color brightyellow "%_?([A-Z_a-z_0-9_]*)"
|
||||
color brightyellow "(?s)%\{.*?\}"
|
||||
color brightyellow "(?s)%\{__.*?\}"
|
||||
color brightyellow (s) "%\{.*?\}"
|
||||
color brightyellow (s) "%\{__.*?\}"
|
||||
color brightyellow "\$(RPM_BUILD_ROOT)\b"
|
||||
color brightmagenta "^%(build$|changelog|check$|clean$|description)"
|
||||
color brightmagenta "^%(files|install$|package|prep$)"
|
||||
|
|
|
@ -8,7 +8,7 @@ color yellow "\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|els
|
|||
## Constants
|
||||
color brightblue "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*"
|
||||
## Ruby "symbols"
|
||||
icolor magenta "([ ]|^):[0-9A-Z_]+\b"
|
||||
magenta (i) "([ ]|^):[0-9A-Z_]+\b"
|
||||
## Some unique things we want to stand out
|
||||
color brightyellow "\b(__FILE__|__LINE__)\b"
|
||||
## Regular expressions
|
||||
|
@ -27,6 +27,7 @@ color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "
|
|||
color cyan "#[^{].*$" "#$"
|
||||
color brightcyan "##[^{].*$" "##$"
|
||||
## "Here" docs
|
||||
color green "(?s)<<-?'?EOT'?.*?^EOT"
|
||||
color green (s) "<<-?'?EOT'?.*?^EOT"
|
||||
## Some common markers
|
||||
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
|
||||
|
||||
|
|
|
@ -21,16 +21,16 @@ color magenta "[A-Z][a-z]+"
|
|||
|
||||
# Strings
|
||||
color green "\".*\""
|
||||
color green "(?s)\".*\\$.*?.*\""
|
||||
color green (s) "\".*\\$.*?.*\""
|
||||
# NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal
|
||||
color green "(?s)r#+\".*?\"#+"
|
||||
color green (s) "r#+\".*?\"#+"
|
||||
|
||||
# Comments
|
||||
color blue "//.*"
|
||||
color blue "(?s)/\*.*?\*/"
|
||||
color blue (s) "/\*.*?\*/"
|
||||
|
||||
# Attributes
|
||||
color magenta "(?s)#!\[.*?\]"
|
||||
color magenta (s) "#!\[.*?\]"
|
||||
|
||||
# Some common markers
|
||||
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
|
||||
|
|
|
@ -7,6 +7,7 @@ color cyan "\b(def|object|case|trait|lazy|implicit|abstract|class|extends|final|
|
|||
color red ""[^"]*""
|
||||
color yellow "\b(true|false|null)\b"
|
||||
color blue "//.*"
|
||||
color blue "(?s)/\*.*?\*/"
|
||||
color brightblue "(?s)/\*\*.*?\*/"
|
||||
color blue (s) "/\*.*?\*/"
|
||||
color brightblue (s) "/\*\*.*?\*/"
|
||||
color ,green "[[:space:]]+$"
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
|||
color green "-[Ldefgruwx]\b"
|
||||
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\b"
|
||||
color brightblue "\b(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\b"
|
||||
icolor brightgreen "^\s+[0-9A-Z_]+\s+\(\)"
|
||||
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
brightgreen (i) "^\s+[0-9A-Z_]+\s+\(\)"
|
||||
brightred (i) "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
||||
color cyan "(^|[[:space:]])#.*$"
|
||||
#color ,green "[[:space:]]+$"
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
syntax "SQL" "\.sql$" "sqliterc$"
|
||||
|
||||
icolor cyan "\b(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\b"
|
||||
icolor cyan "\b(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\b"
|
||||
icolor cyan "\b(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\b"
|
||||
icolor cyan "\b(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\b"
|
||||
icolor cyan "\b(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\b"
|
||||
icolor cyan "\b(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\b"
|
||||
icolor cyan "\b(GROUP|GRANT|HAVING)\b"
|
||||
icolor cyan "\b(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\b"
|
||||
icolor cyan "\b(JOIN|KEYS|KILL|KEY)\b"
|
||||
icolor cyan "\b(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\b"
|
||||
icolor cyan "\b(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\b"
|
||||
icolor cyan "\b(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\b"
|
||||
icolor cyan "\b(PROCEDURE|PROCEDURAL|PRIMARY)\b"
|
||||
icolor cyan "\b(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\b"
|
||||
icolor cyan "\b(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\b"
|
||||
icolor cyan "\b(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\b"
|
||||
icolor cyan "\b(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\b"
|
||||
icolor cyan "\b(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\b"
|
||||
cyan (i) "\b(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\b"
|
||||
cyan (i) "\b(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\b"
|
||||
cyan (i) "\b(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\b"
|
||||
cyan (i) "\b(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\b"
|
||||
cyan (i) "\b(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\b"
|
||||
cyan (i) "\b(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\b"
|
||||
cyan (i) "\b(GROUP|GRANT|HAVING)\b"
|
||||
cyan (i) "\b(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\b"
|
||||
cyan (i) "\b(JOIN|KEYS|KILL|KEY)\b"
|
||||
cyan (i) "\b(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\b"
|
||||
cyan (i) "\b(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\b"
|
||||
cyan (i) "\b(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\b"
|
||||
cyan (i) "\b(PROCEDURE|PROCEDURAL|PRIMARY)\b"
|
||||
cyan (i) "\b(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\b"
|
||||
cyan (i) "\b(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\b"
|
||||
cyan (i) "\b(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\b"
|
||||
cyan (i) "\b(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\b"
|
||||
cyan (i) "\b(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\b"
|
||||
color green "\b(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)\b"
|
||||
|
||||
# SQLite meta commands
|
||||
icolor cyan "\.\b(databases|dump|echo|exit|explain|header(s)?|help)\b"
|
||||
icolor cyan "\.\b(import|indices|mode|nullvalue|output|prompt|quit|read)\b"
|
||||
icolor cyan "\.\b(schema|separator|show|tables|timeout|width)\b"
|
||||
cyan (i) "\.\b(databases|dump|echo|exit|explain|header(s)?|help)\b"
|
||||
cyan (i) "\.\b(import|indices|mode|nullvalue|output|prompt|quit|read)\b"
|
||||
cyan (i) "\.\b(schema|separator|show|tables|timeout|width)\b"
|
||||
color brightcyan "\b(ON|OFF)\b"
|
||||
|
||||
color blue "\b([0-9]+)\b"
|
||||
|
|
|
@ -33,7 +33,7 @@ color red ""[^"]*""
|
|||
# Comments
|
||||
color green "//.*"
|
||||
color brightgreen "///.*"
|
||||
color green "(?s)/\*\*.*?\*/"
|
||||
color green (s) "/\*\*.*?\*/"
|
||||
color green "[/**]"
|
||||
|
||||
# Trailing whitespace
|
||||
|
|
|
@ -17,7 +17,7 @@ color brightyellow "\b[0-9]+(\.[0-9]+)?\b"
|
|||
## Strings
|
||||
color yellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
||||
## Variables
|
||||
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
brightred (i) "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
## Comments
|
||||
color magenta "(^|;)[[:space:]]*#.*"
|
||||
## Trailing whitespace
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
##
|
||||
syntax "TeX" "\.tex$" "bib" "\.bib$" "cls" "\.cls$"
|
||||
color yellow "\$[^$]*\$"
|
||||
icolor green "\\.|\\[A-Z]*"
|
||||
green (i) "\\.|\\[A-Z]*"
|
||||
color magenta "[{}]"
|
||||
color blue "%.*"
|
||||
color blue "(?s)\\begin\{comment\}.*?\\end\{comment\}"
|
||||
color blue (s) "\\begin\{comment\}.*?\\end\{comment\}"
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ color blue "\b([0-9]+)\b"
|
|||
color red "[-+/*=<>?:!~%&|]" "->"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightblack "(^|[[:space:]])//.*"
|
||||
color brightblack "(?s)/\*.*?\*/"
|
||||
color brightblack (s) "/\*.*?\*/"
|
||||
color brightwhite,cyan "TODO:?"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
|
||||
syntax "XML" ".*\.([jrs]?html?|xml|sgml?|rng)$"
|
||||
color white "^.+$"
|
||||
color green "(?s)<.*?>"
|
||||
color green (s) "<.*?>"
|
||||
color cyan "<[^> ]+"
|
||||
color cyan ">"
|
||||
color yellow "(?s)<!DOCTYPE.*?[/]?>"
|
||||
color yellow "(?s)<!--.*?-->"
|
||||
color yellow (s) "<!DOCTYPE.*?[/]?>"
|
||||
color yellow (s) "<!--.*?-->"
|
||||
color red "&[^;]*;"
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@ color brightmagenta "\b((g|ig)?awk|find|\w{0,4}grep|kill|killall|\w{0,4}less|mak
|
|||
color brightmagenta "\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|echo|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\b"
|
||||
|
||||
## Function definition
|
||||
icolor brightgreen "^\s+(function\s+)[0-9A-Z_]+\s+\(\)"
|
||||
brightgreen (i) "^\s+(function\s+)[0-9A-Z_]+\s+\(\)"
|
||||
|
||||
## Variables
|
||||
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
brightred (i) "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
|
||||
## Strings
|
||||
color yellow ""(\\.|[^"])*""
|
||||
|
|
Loading…
Reference in a new issue