2006-06-01 17:23:28 +00:00
|
|
|
## Here is an example for Python.
|
2014-05-16 20:21:34 +00:00
|
|
|
|
2018-02-07 10:25:46 +00:00
|
|
|
syntax python "\.py$"
|
2014-09-21 15:29:40 +00:00
|
|
|
header "^#!.*python[-0-9._]*"
|
2017-11-19 10:10:53 +00:00
|
|
|
magic "Python script"
|
2015-04-18 11:35:23 +00:00
|
|
|
linter pyflakes
|
2016-05-25 20:13:50 +00:00
|
|
|
comment "#"
|
2014-05-12 16:01:57 +00:00
|
|
|
|
|
|
|
# Function definitions.
|
2006-06-01 17:23:28 +00:00
|
|
|
icolor brightblue "def [0-9A-Z_]+"
|
2014-05-12 16:01:57 +00:00
|
|
|
# Keywords.
|
2017-12-10 07:46:02 +00:00
|
|
|
color brightcyan "\<(and|as|assert|async|await|break|class|continue)\>"
|
|
|
|
color brightcyan "\<(def|del|elif|else|except|exec|finally|for|from)\>"
|
|
|
|
color brightcyan "\<(global|if|import|in|is|lambda|nonlocal|not|or)\>"
|
|
|
|
color brightcyan "\<(pass|print|raise|return|try|while|with|yield)\>"
|
2014-05-12 18:10:08 +00:00
|
|
|
|
2015-12-02 10:29:18 +00:00
|
|
|
# Single-quoted strings.
|
|
|
|
color brightgreen "'([^'\]|\\.)+'"
|
|
|
|
color brightgreen ""([^"\]|\\.)+""
|
2015-03-25 13:50:12 +00:00
|
|
|
# Comments.
|
|
|
|
color brightred "(^|[[:blank:]])#.*$"
|
2015-12-02 10:29:18 +00:00
|
|
|
# Triple-quoted strings.
|
2017-07-22 18:51:17 +00:00
|
|
|
color brightgreen start="'''([^'),]|$)" end="(^|[^(\])'''"
|
|
|
|
color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(\])\"\"\""
|
2014-05-12 18:10:08 +00:00
|
|
|
|
2017-12-10 13:27:21 +00:00
|
|
|
# Special values.
|
|
|
|
color brightmagenta "\<(False|None|True)\>"
|
|
|
|
|
2014-05-12 18:10:08 +00:00
|
|
|
# Reminders.
|
2017-12-10 13:27:21 +00:00
|
|
|
color brightwhite,yellow "(FIXME|TODO|XXX)"
|
2014-03-24 12:45:20 +00:00
|
|
|
|
2014-05-12 16:01:57 +00:00
|
|
|
# Trailing whitespace.
|
2014-03-24 12:45:20 +00:00
|
|
|
color ,green "[[:space:]]+$"
|