From d58c6974a5eb677029c7e4f0014bc8f80ed050c4 Mon Sep 17 00:00:00 2001 From: s-ol Date: Fri, 9 Jul 2021 15:41:21 +0200 Subject: add kakoune highlighting file --- extra/subv.kak | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 extra/subv.kak diff --git a/extra/subv.kak b/extra/subv.kak new file mode 100644 index 0000000..fc4eeff --- /dev/null +++ b/extra/subv.kak @@ -0,0 +1,28 @@ +### subv.kak - Semantic Highlighting for SubV + +# Detection +hook global BufCreate .*[.](subv) %{ + set-option buffer filetype subv +} + +# Highlighters +add-highlighter shared/subv regions +add-highlighter shared/subv/comment region '#' '$' fill comment +add-highlighter shared/subv/code default-region group +add-highlighter shared/subv/code/segment regex '^\s+(== [^\n ]+( 0x[\da-z]+)?)' 1:builtin +add-highlighter shared/subv/code/label regex '^([^ \n]+:)' 1:variable +add-highlighter shared/subv/code/partnum regex '\b(-?[\da-f]+|([^/ \n]+))/([^/ \n]+)(/([^/ \n]+))?\b' 5:+d 1:value 2:variable 3:meta +add-highlighter shared/subv/code/opcode regex '^\s+([\da-f]{2})/(\w+)' 0:+b@keyword + +# Initialization +hook -group subv-highlight global WinSetOption filetype=subv %{ + add-highlighter window/subv ref subv + + hook -once -always window WinSetOption filetype=.* %{ + remove-highlighter window/subv + } + + set-option buffer comment_line '# ' + set-option buffer tabstop 2 + set-option buffer indentwidth 2 +} -- cgit v1.2.3