mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-11 01:37:41 +03:00
Add a cmake.kak file for highlighting cmake files
This commit is contained in:
parent
9053dadfc3
commit
a6c8dcf305
22
rc/extra/cmake.kak
Normal file
22
rc/extra/cmake.kak
Normal file
@ -0,0 +1,22 @@
|
||||
hook global BufCreate .+\.cmake|.*/CMakeLists.txt %{
|
||||
set-option buffer filetype cmake
|
||||
}
|
||||
|
||||
add-highlighter shared/ regions -match-capture -default code cmake \
|
||||
comment '#' '$' '' \
|
||||
argument '\w+\h*\(\K' '(?=\))' '\(' \
|
||||
|
||||
add-highlighter shared/cmake/argument regions -match-capture -default args argument \
|
||||
quoted '"' '(?<!\\)(\\\\)*"' '' \
|
||||
quoted '\[(=*)\[' '\](=*)\]' ''
|
||||
|
||||
add-highlighter shared/cmake/comment fill comment
|
||||
add-highlighter shared/cmake/code regex '\w+\h*(?=\()' 0:meta
|
||||
|
||||
add-highlighter shared/cmake/argument/argument/args regex '\$\{\w+\}' 0:variable
|
||||
add-highlighter shared/cmake/argument/argument/quoted fill string
|
||||
add-highlighter shared/cmake/argument/argument/quoted regex '\$\{\w+\}' 0:variable
|
||||
add-highlighter shared/cmake/argument/argument/quoted regex '\w+\h*(?=\()' 0:function
|
||||
|
||||
hook -group cmake-highlight global WinSetOption filetype=cmake %{ add-highlighter window ref cmake }
|
||||
hook -group cmake-highlight global WinSetOption filetype=(?!cmake).* %{ remove-highlighter window/cmake }
|
Loading…
Reference in New Issue
Block a user