This is the first push to this repo with my dotfiles
[dotfilesold/.git] / .nano / python.nanorc
1 ## Python syntax highlighting rules for Nano
2
3 syntax "python" "\.py$"
4 header "^#!.*/(env +)?python[-0-9._]*( |$)"
5 magic "Python script"
6 comment "#"
7
8 linter pyflakes
9
10 ## built-in objects
11 color cyan "\<(None|self|True|False)\>"
12 ## built-in attributes
13 color cyan "\<(__builtin__|__dict__|__methods__|__members__|__class__|__bases__|__import__|__name__|__doc__|__self__|__debug__)\>"
14 ## built-in functions
15 color cyan "\<(abs|append|apply|buffer|callable|chr|clear|close|closed|cmp|coerce|compile|complex|conjugate|copy|count|delattr|dir|divmod|eval|execfile|exec|extend|fileno|filter|float|flush|get|getattr|globals|has_key|hasattr|hash|hex|id|index|input|insert|int|intern|isatty|isinstance|issubclass|items|keys|len|list|locals|long|map|max|min|mode|name|oct|open|ord|pop|pow|print|range|raw_input|read|readline|readlines|reduce|reload|remove|repr|reverse|round|seek|setattr|slice|softspace|sort|str|tell|truncate|tuple|type|unichr|unicode|update|values|vars|write|writelines|xrange|zip)\>"
16 ## built-in functions that were previously keywords
17 color brightblue "\<(print|exec)\>([[:space:]]|$)"
18 ## special method names
19 color cyan "\<(__abs__|__add__|__and__|__call__|__cmp__|__coerce__|__complex__|__concat__|__contains__|__del__|__delattr__|__delitem__|__delslice__|__div__|__divmod__|__float__|__getattr__|__getitem__|__getslice__|__hash__|__hex__|__init__|__int__|__inv__|__invert__|__len__|__long__|__lshift__|__mod__|__mul__|__neg__|__nonzero__|__oct__|__or__|__pos__|__pow__|__radd__|__rand__|__rcmp__|__rdiv__|__rdivmod__|__repeat__|__repr__|__rlshift__|__rmod__|__rmul__|__ror__|__rpow__|__rrshift__|__rshift__|__rsub__|__rxor__|__setattr__|__setitem__|__setslice__|__str__|__sub__|__xor__)\>"
20 ## exception classes
21 color cyan "\<(Exception|StandardError|ArithmeticError|LookupError|EnvironmentError|AssertionError|AttributeError|EOFError|FloatingPointError|IOError|ImportError|IndexError|KeyError|KeyboardInterrupt|MemoryError|NameError|NotImplementedError|OSError|OverflowError|RuntimeError|SyntaxError|SystemError|SystemExit|TypeError|UnboundLocalError|UnicodeError|ValueError|WindowsError|ZeroDivisionError)\>"
22 ## types
23 color brightcyan "\<(NoneType|TypeType|IntType|LongType|FloatType|ComplexType|StringType|UnicodeType|BufferType|TupleType|ListType|DictType|FunctionType|LambdaType|CodeType|ClassType|UnboundMethodType|InstanceType|MethodType|BuiltinFunctionType|BuiltinMethodType|ModuleType|FileType|XRangeType|TracebackType|FrameType|SliceType|EllipsisType)\>"
24 ## definitions
25 color brightcyan "def [a-zA-Z_0-9]+" 
26 ## keywords
27 color brightblue "\<(and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|map|not|or|pass|raise|return|try|with|while|yield)\>"
28
29 ## decorators
30 color brightgreen "@.*[(]"
31
32 ## operators
33 color magenta "[.:;,+*|=!\%@]" "<" ">" "/" "-" "&"
34
35 ## parentheses
36 color magenta "[(){}]" "\[" "\]"
37
38 ## numbers
39 icolor brightyellow "\b(([1-9][0-9]+)|0+)\.[0-9]+j?\b" "\b([1-9][0-9]*[Lj]?)\b" "\b0o?[0-7]*L?\b" "\b0x[1-9a-f][0-9a-f]*L?\b" "\b0b[01]+\b"
40
41
42 ## strings
43 color yellow "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
44 color yellow "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
45
46 ## comments
47 color green "^#.*|[[:space:]]#.*$"
48
49 ## block comments
50 color yellow start=""""[^"]" end=""""" start="'''[^']" end="'''"
51
52 ## trailing spaces
53 color ,green "[[:space:]]+$"
54
55 ## reminders
56 color brightwhite,yellow "(FIXME|TODO|XXX)"