python.nanorc 801 Bytes
Newer Older
1
## Here is an example for Python.
2

3
syntax "python" "\.py$"
4
header "^#!.*python[-0-9._]*"
5
linter pyflakes
6
comment "#"
7
8

# Function definitions.
9
icolor brightblue "def [0-9A-Z_]+"
10
# Keywords.
11
12
color brightcyan "\<(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from)\>"
color brightcyan "\<(global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield)\>"
13

14
15
16
# Single-quoted strings.
color brightgreen "'([^'\]|\\.)+'"
color brightgreen ""([^"\]|\\.)+""
17
18
# Comments.
color brightred "(^|[[:blank:]])#.*$"
19
# Triple-quoted strings.
20
21
color brightgreen    start="'''([^'),]|$)" end="(^|[^(\])'''"
color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(\])\"\"\""
22
23
24

# Reminders.
color ,yellow "(FIXME|TODO|XXX)"
25

26
# Trailing whitespace.
27
color ,green "[[:space:]]+$"