This is the first push to this repo with my dotfiles
[dotfilesold/.git] / .nano / lua.nanorc
1 ##############################################################################
2 #
3 # Lua syntax highlighting for Nano.
4 #
5 # Author:  Matthew Wild <mwild1 (at) gmail.com>
6 # License: GPL 2  or later
7 #
8 # Version: 2007-06-06
9 #
10 # Notes: Originally based on Ruby syntax rc by Josef 'Jupp' Schugt
11 ##############################################################################
12
13
14 # Automatically use for '.lua' files
15 syntax "Lua" ".*\.lua$"
16 magic "Lua script"
17 comment "--"
18
19 linter luacheck --no-color
20
21 # General
22 color brightwhite ".+"
23
24 # Operators
25 color brightyellow ":|\*\*|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|\<(not|and|or)\>"
26
27 # Statements
28 color brightblue "\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return)\>"
29
30 # Keywords
31 color brightyellow "\<(debug|string|math|table|io|coroutine|os|utf8|bit32)\>\."
32 color brightyellow "\<(_ENV|_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\s*\("
33
34 # Standard library
35 color brightyellow "io\.\<(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)\>"
36 color brightyellow "math\.\<(abs|acos|asin|atan2|atan|ceil|cosh|cos|deg|exp|floor|fmod|frexp|huge|ldexp|log10|log|max|maxinteger|min|mininteger|modf|pi|pow|rad|random|randomseed|sinh|sqrt|tan|tointeger|type|ult)\>"
37 color brightyellow "os\.\<(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)\>"
38 color brightyellow "package\.\<(config|cpath|loaded|loadlib|path|preload|seeall|searchers|searchpath)\>"
39 color brightyellow "string\.\<(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\>"
40 color brightyellow "table\.\<(concat|insert|maxn|move|pack|remove|sort|unpack)\>"
41 color brightyellow "utf8\.\<(char|charpattern|codes|codepoint|len|offset)\>"
42 color brightyellow "coroutine\.\<(create|isyieldable|resume|running|status|wrap|yield)\>"
43 color brightyellow "debug\.\<(debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|setfenv|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin)\>"
44 color brightyellow "bit32\.\<(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)\>"
45
46 # File handle methods
47 color brightyellow "\:\<(close|flush|lines|read|seek|setvbuf|write)\>"
48
49 # false, nil, true
50 color brightmagenta "\<(false|nil|true)\>"
51
52 # External files
53 color brightgreen "(\<(dofile|require|include)|%q|%!|%Q|%r|%x)\>"
54
55 # Numbers
56 color red "\<([0-9]+)\>"
57
58 # Symbols
59 color brightmagenta "(\(|\)|\[|\]|\{|\})"
60
61 # Strings
62 color red "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
63
64 # Multiline strings
65 color red start="\s*\[\[" end="\]\]"
66
67 # Escapes
68 color red "\\[0-7][0-7][0-7]|\\x[0-9a-fA-F][0-9a-fA-F]|\\[abefnrs]|(\\c|\\C-|\\M-|\\M-\\C-)."
69
70 # Shebang
71 color brightcyan "^#!.*"
72
73 # Simple comments
74 color green "\-\-.*$"
75
76 # Multiline comments
77 color green start="\s*\-\-\s*\[\[" end="\]\]"
78
79 # Trailing whitespaces
80 color ,green "[[:space:]]+$"