-
Notifications
You must be signed in to change notification settings - Fork 0
/
go.nanorc
56 lines (41 loc) · 1.54 KB
/
go.nanorc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Syntax highlighting for Go.
syntax go "\.go$"
comment "// "
tabgives " "
# Reserved Keywords.
color blue "\<(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\>"
# Types.
color magenta "\<(any|bool|byte|comparable)\>"
color magenta "\<(complex64|complex128|error|float32|float64)\>"
color magenta "\<(int|int8|int16|int32|int64|rune|string)\>"
color magenta "\<(uint|uint8|uint16|uint32|uint64|uintptr)\>"
# Constants.
color yellow "\<(true|false|iota)\>"
color yellow "\<(nil)\>"
# Functions.
color magenta "\<(append|cap|clear|close|complex|copy|delete|imag|len)\>"
color magenta "\<(make|max|min|new|panic|print|println|real|recover)\>"
# Numbers.
icolor yellow "\<[0-9]+(_[0-9]+)*(\.[0-9]*(_[0-9]+)*)?(e[+-]?[0-9]+(_[0-9]+)*)?i?\>"
icolor yellow "\<0b(_?[0-1]+)+\>"
icolor yellow "\<0o(_?[0-7]+)+\>"
icolor yellow "\<0x(_?[0-9a-f]+)+\>"
# Runes.
color yellow "'(\\[xuU]?[0-9A-Fa-f]{2,8}|\\[abfnrtv\']|[^\'])'"
# Multiline strings.
color green start="^("([^"\]|\\.)*"|`[^`]*`|[^"`]|)+[=+]\s*`[^`]*$" end="`"
color normal "^("([^"\]|\\.)*"|`[^`]*`|[^"`])+[=+]\s*`"
color blue "^\s*\<(const|var)\>"
color green "`"
color yellow "'`'"
color green start="^[^`=+]*`[^`]*\+\s*`[^`]*$" end="`"
# Strings.
color green ""([^"\]|\\.)*""
color green "`[^`]*`"
# Comments.
color red "^\s*//.*$"
color red "//("([^"\]|\\.)*"|'([^'\]|\\.)*'|`[^`]*`|[^"'`])*$"
# Multiline comments.
color red start="^\s*/\*" end="\*/\s*$"
# Trailing whitespaces.
color ,green " +$"