From 904cec3c4a329cf89fc3219d359239910d61f3f6 Mon Sep 17 00:00:00 2001 From: thing1 Date: Tue, 28 Jan 2025 09:14:32 +0000 Subject: init commit --- autoload/filetype/cmake.kak | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 autoload/filetype/cmake.kak (limited to 'autoload/filetype/cmake.kak') diff --git a/autoload/filetype/cmake.kak b/autoload/filetype/cmake.kak new file mode 100644 index 0000000..86fda25 --- /dev/null +++ b/autoload/filetype/cmake.kak @@ -0,0 +1,36 @@ +hook global BufCreate .+\.cmake|.*/CMakeLists.txt %{ + set-option buffer filetype cmake +} + +hook global BufCreate .*/CMakeCache.txt %{ + set-option buffer filetype ini +} + +hook global WinSetOption filetype=cmake %{ + require-module cmake +} + +hook -group cmake-highlight global WinSetOption filetype=cmake %{ + add-highlighter window/cmake ref cmake + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/cmake } +} + +provide-module cmake %{ + +add-highlighter shared/cmake regions +add-highlighter shared/cmake/code default-region group +add-highlighter shared/cmake/comment region '#' '$' fill comment +add-highlighter shared/cmake/argument region -recurse '\(' '\w+\h*\(\K' '(?=\))' regions + +add-highlighter shared/cmake/code/ regex '\w+\h*(?=\()' 0:meta + +add-highlighter shared/cmake/argument/args default-region regex '\$\{\w+\}' 0:variable +add-highlighter shared/cmake/argument/comment region '#' '$' fill comment +add-highlighter shared/cmake/argument/quoted region '"' '(?