diff options
| author | s-ol <s+removethis@s-ol.nu> | 2021-07-09 13:41:21 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2021-07-09 14:23:33 +0000 |
| commit | d58c6974a5eb677029c7e4f0014bc8f80ed050c4 (patch) | |
| tree | 7bf5467c9e144c481495670dde6d5dea752cc944 | |
| parent | remove 0x prefix (diff) | |
| download | subv-d58c6974a5eb677029c7e4f0014bc8f80ed050c4.tar.gz subv-d58c6974a5eb677029c7e4f0014bc8f80ed050c4.zip | |
add kakoune highlighting file
| -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 +} |
