From 40aaf63338021fee8377c74f2581a1c728be3fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Ros=C3=A9n?= Date: Sun, 7 Jan 2018 23:30:35 +0100 Subject: Highlight python doctests in docstrings --- rc/core/python.kak | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'rc/core/python.kak') diff --git a/rc/core/python.kak b/rc/core/python.kak index 971fbce3..1083c8d7 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 '"' (?>> \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{ -- cgit v1.2.3 From a612432c8d7eeec35873bb788ead2402c92592b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Ros=C3=A9n?= Date: Sun, 7 Jan 2018 23:35:54 +0100 Subject: Highlight python operators --- rc/core/python.kak | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rc/core/python.kak') diff --git a/rc/core/python.kak b/rc/core/python.kak index 1083c8d7..a0f66217 100644 --- a/rc/core/python.kak +++ b/rc/core/python.kak @@ -120,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 # ‾‾‾‾‾‾‾‾ -- cgit v1.2.3