diff --git a/python.nanorc b/python.nanorc index 8118a54..1fba73e 100644 --- a/python.nanorc +++ b/python.nanorc @@ -1,6 +1,11 @@ # -# Monokai like theme for python as used in PyCharm IDE +# MONOKAI like theme for python as used in the PyCharm IDE # +# This theme uses extended colors of the gnome terminal. The standard command line +# may not reproduce the desired colors! +# +# A default gnome terminal theme could have unintended effects of the theme colors +# as well. Please use the default one! syntax python "\.py$" header "^#!.*python" @@ -8,14 +13,39 @@ magic "Python script" comment "#" color white ".*" + +# Function or method calls color cyan "\w+\(" -color orange "def \w+\(.*\):" + +# Parameters inside method or function definitions. +color orange "def \w+\(.*\)( *-> *\w+){0,1}:" + +# Function/method names on definitions color green "def \w+\(" -color brightcyan "\b(class|def|import|return|for|while|in|if|elif|else|raise|is|not|and|or|with|continue|break|try|except|finally)(:| )" -color cyan "\b(True|False|None)" -color white ": *\w+ *(,|\))" + +# Statements +color brightcyan "\<(class|def|import|from|return|for|while|global|in|if|elif|else|raise|is|not|and|or|with|continue|break|try|except|finally|pass|yield)\>" + +# Parameter type definitions +color white ": *[a-zA-Z_.]+ *(,|\)|= *\w*)" + +# Return type definitions +color white "-> *\w+:" + +# Operators color red "(=|ยท|\/|\+|-|\*|\!|>|<|:)" + +color cyan "\<(True|False|None)\>" + color white "(\(|\)|,|\.|->)" + +# Number values color brightmagenta "([0-9]|[0-9]+\.[0-9]+|self)" -color grey "#.*" -color yellow "(\"|').*?(\"|')" + +# Strings +color yellow "'([^'\]|\\.)*'|"([^"\]|\\.)*"|'''|"""" + +# Comments +color grey "(^|[[:blank:]])#.*" +color grey start="'''([^'),]|$)" end="(^|[^(\])'''" +color grey start=""""([^"),]|$)" end="(^|[^(\])""""