├── README.md ├── images └── screenshot.png └── zig.kak /README.md: -------------------------------------------------------------------------------- 1 | # zig.kak 2 | 3 | Syntax highlighting for the [Zig language][zig] in the [Kakoune editor][kakoune], for those who like to pair their new-age hipster bullshit programming language with a new-age hipster bullshit text editor. 4 | 5 | ### Screenshot: 6 | 7 | ![Screenshot with syntax highlighting](images/screenshot.png "Screenshot with syntax highlighting") 8 | 9 | [zig]: https://ziglang.org/ 10 | [kakoune]: http://kakoune.org/ 11 | -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eira-fransham/zig-kak/d67fc09e5095306883bd56d6cb00645eb8045333/images/screenshot.png -------------------------------------------------------------------------------- /zig.kak: -------------------------------------------------------------------------------- 1 | # Kakoune mode for zig-lang 2 | 3 | hook global BufCreate .*[.]zig %{ 4 | set-option buffer filetype zig 5 | } 6 | 7 | addhl shared/zig regions 8 | addhl shared/zig/code default-region group 9 | addhl shared/zig/comment-line region '//' '$' fill comment 10 | addhl shared/zig/double-string region 'c?"' (?|<|%|<<%?|>>)=?' 0:default 26 | addhl shared/zig/code/builtin regex '(@)(\w+)' 1:default 2:function 27 | addhl shared/zig/code/num regex '\b[0-9]+(.[0-9]+)=([eE][+-]?[0-9]+)=' 0:value 28 | addhl shared/zig/code/hex regex '\b0x[a-fA-F0-9]+([a-fA-F0-9]+([pP][+-]?[0-9]+)?)=' 0:value 29 | addhl shared/zig/code/oct regex '\b0o[0-7]+' 0:value 30 | addhl shared/zig/code/bin regex '\b0b[01]+(.[01]+([eE][\+-]?[0-9]+)?)=' 0:value 31 | 32 | hook -group zig-highlight global WinSetOption filetype=zig %{ add-highlighter window/ ref zig } 33 | hook -group zig-highlight global WinSetOption filetype=(?!zig).* %{ remove-highlighter window/zig } 34 | --------------------------------------------------------------------------------