diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-01-08 09:45:02 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-01-08 09:45:02 +1100 |
| commit | c308cddcd8d0fb271eee3d723986da1e18c8edf4 (patch) | |
| tree | 6434d1c1dc6a893d333c7e375e30c9bbec43fe1c | |
| parent | 996d8abef4d58c1d196d9b5db422b1101e583738 (diff) | |
| parent | a612432c8d7eeec35873bb788ead2402c92592b8 (diff) | |
Merge remote-tracking branch 'danr/pyhl'
| -rw-r--r-- | rc/core/python.kak | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/rc/core/python.kak b/rc/core/python.kak index 971fbce3..a0f66217 100644 --- a/rc/core/python.kak +++ b/rc/core/python.kak @@ -12,8 +12,8 @@ hook global BufCreate .*[.](py) %{ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ add-highlighter shared/ regions -default code python \ - double_string '"""' '"""' '' \ - single_string "'''" "'''" '' \ + docstring '"""' '"""' '' \ + docstring "'''" "'''" '' \ double_string '"' (?<!\\)(\\\\)*" '' \ single_string "'" (?<!\\)(\\\\)*' '' \ comment '#' '$' '' @@ -32,6 +32,13 @@ add-highlighter shared/python/code regex '\b\d+\+\d+[jJ]\b' 0:value add-highlighter shared/python/double_string fill string add-highlighter shared/python/single_string fill string + +add-highlighter shared/python/docstring/ regions -default docstring py-docstring \ + python '>>> \K' '\z' '' \ + python '\.\.\. \K' '\z' '' +add-highlighter shared/python/docstring/py-docstring/python ref python +add-highlighter shared/python/docstring/py-docstring/docstring fill string + add-highlighter shared/python/comment fill comment %sh{ @@ -113,6 +120,9 @@ add-highlighter shared/python/comment fill comment " } +add-highlighter shared/python/code regex (?<=[\w\s\d'"_])(<=|<<|>>|>=|<>|<|>|!=|==|\||\^|&|\+|-|\*\*|\*|//|/|%|~) 0:operator +add-highlighter shared/python/code regex (?<=[\w\s\d'"_])((?<![=<>!])=(?![=])|[+*-]=) 0:builtin + # Commands # ‾‾‾‾‾‾‾‾ |
