forked from scopatz/nanorc
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## Here is an example nanorc for syntax highlighting in Zeek scripts. Edited the standard sh.nanorc to create this, and added in the regex described by Scott Runnels. | ||
## For Scott's bro-mode.el, go to https://github.com/srunnels/bro-mode/blob/master/bro-mode.el | ||
|
||
syntax "zeek" "\.zeek$" | ||
magic "(POSIX|Bourne.*) shell script text" | ||
header "^#!.*/(ba|k|pdk)?sh[-0-9_]*" | ||
icolor brightgreen "^[0-9A-Z_]+\(\)" | ||
|
||
color cyan "(usec|msec|sec|min|hr|day)s?\b" | ||
color cyan "[0-9]+\/(tcp|udp|icmp|unknown)" | ||
|
||
# Functions and event names | ||
color magenta "\w+\(" | ||
|
||
# Declarations and statements | ||
color brightcyan "\<(add|alarm|fallthrough|break|case|const|copy|continue|do|delete|else|for|global|switch|default|if|endif|local|next|of|print|redef|return|schedule|type|when|while|option)\>" | ||
color brightcyan "module|export|timeout" | ||
|
||
# Types | ||
color cyan "\<(addr|opaque|any|bool|hook|connection|function|count|time|double|file|int|enum|event|interval|net|port|pattern|record|set|string|subnet|table|vector)\>" | ||
|
||
# Namespaces | ||
color yellow "(\w+?)::\b" | ||
|
||
# Operators | ||
color green "(:|\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|& |&&|\||\?|%|\+|\*|-\W| as |\^|~| not | in | is | !in | : |,)" | ||
|
||
# attributes | ||
color brightgreen "\&(expire_func|redef|priority|log|optional|default|add_func|delete_func|read_expire|write_expire|create_expire|on_change|raw_output|error_handler|type_column|deprecated)" | ||
|
||
# Directives and record references | ||
icolor brightred "(@\w+)" | ||
icolor red "(\w+?)\$\{?[0-9A-Z_!@#$*?-]+\}?" | ||
|
||
# string literals | ||
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" | ||
|
||
# Comments | ||
color blue "(^|[[:space:]])#.*$" |