Enhancements for comments, strings and parameter types

This commit is contained in:
Mal 2022-05-22 20:07:01 +02:00
parent b1b011349c
commit 2c53f9fcdd
1 changed files with 37 additions and 7 deletions

View File

@ -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$" syntax python "\.py$"
header "^#!.*python" header "^#!.*python"
@ -8,14 +13,39 @@ magic "Python script"
comment "#" comment "#"
color white ".*" color white ".*"
# Function or method calls
color cyan "\w+\(" 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 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)" # Statements
color white ": *\w+ *(,|\))" 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 red "(=|·|\/|\+|-|\*|\!|>|<|:)"
color cyan "\<(True|False|None)\>"
color white "(\(|\)|,|\.|->)" color white "(\(|\)|,|\.|->)"
# Number values
color brightmagenta "([0-9]|[0-9]+\.[0-9]+|self)" 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="(^|[^(\])""""