mirror of
git://git.sv.gnu.org/nano.git
synced 2024-12-13 22:37:21 +03:00
6a2032f5b0
This allows for commenting or uncommenting a line or a bunch of lines with a single keystroke (default binding: M-3). The characters used for commenting/uncommenting are specified by the active syntax file. Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Mike Scalora <mike@scalora.org>
21 lines
668 B
Plaintext
21 lines
668 B
Plaintext
## Here is an example for Javascript.
|
|
|
|
syntax "javascript" "\.js$"
|
|
comment "//"
|
|
|
|
color brightred "\<[A-Z_][0-9A-Z_]+\>"
|
|
color green "\<(const|function|let|this|typeof|var|void)\>"
|
|
color brightyellow "\<(for|if|while|with|do|else|case|default|switch)\>"
|
|
color brightyellow "\<(export|try|throw|catch|new|delete)\>"
|
|
color magenta "\<(continue|break|return|yield)\>"
|
|
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
|
|
|
# Strings.
|
|
color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
|
# Comments.
|
|
color brightblue "//.*"
|
|
color brightblue start="/\*" end="\*/"
|
|
|
|
# Trailing whitespace.
|
|
color ,green "[[:space:]]+$"
|