diff options
| -rw-r--r-- | extra/subv.kak | 28 |
1 files changed, 28 insertions, 0 deletions
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 +} |
