view nanorc.d/python.nanorc @ 124:c3320f06d412

Add a minimal global gitignore We could add more, but this is intended for things that only I need to ignore (such as build directories that other people might do differently) rather than stuff that everyone wants to do (like ignoring .pyc files or log files in the project)
author IBBoard <dev@ibboard.co.uk>
date Wed, 13 Mar 2019 19:19:50 +0000
parents 5f2c5800fa8a
children
line wrap: on
line source

## Here is an example for Python.

syntax "python" "\.py$"
header "^#!.*python[-0-9._]*"
magic "Python script"
linter pyflakes
comment "#"

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

# Single-quoted strings.
color yellow "'([^'\]|\\.)+'|''"
color yellow ""([^"\]|\\.)+"|"""
# Comments.
color green "(^|[[:blank:]])#.*$"
# Triple-quoted strings.
color green    start="'''([^'),]|$)" end="(^|[^(\])'''"
color green start="\"\"\"([^"),]|$)" end="(^|[^(\])\"\"\""

# Special values.
color red "\<(False|None|True)\>"

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

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