mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-28 17:13:00 +03:00
d49555fc75
That means we can now have highlighters active at global, buffer, and window scope. The add-highlighter and remove-highlighter syntax changed to take the parent path (scope/group/...) as a mandatory argument, superseeding the previous -group switch.
49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
# http://sass-lang.com
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
# require css.kak
|
|
|
|
# Detection
|
|
# ‾‾‾‾‾‾‾‾‾
|
|
|
|
hook global BufCreate .*[.](scss) %{
|
|
set buffer filetype scss
|
|
}
|
|
|
|
# Highlighters
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
add-highlighter shared/ regions -default core scss \
|
|
comment // $ ''
|
|
|
|
add-highlighter shared/scss/comment fill comment
|
|
|
|
add-highlighter shared/scss/core ref css
|
|
|
|
add-highlighter shared/scss/core regex @[A-Za-z][A-Za-z0-9_-]* 0:meta
|
|
|
|
# Commands
|
|
# ‾‾‾‾‾‾‾‾
|
|
|
|
def -hidden scss-filter-around-selections css-filter-around-selections
|
|
def -hidden scss-indent-on-new-line css-indent-on-new-line
|
|
def -hidden scss-indent-on-closing-curly-brace css-indent-on-closing-curly-brace
|
|
|
|
# Initialization
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
hook -group scss-highlight global WinSetOption filetype=scss %{ add-highlighter window ref scss }
|
|
|
|
hook global WinSetOption filetype=scss %[
|
|
hook window InsertEnd .* -group scss-hooks scss-filter-around-selections
|
|
hook window InsertChar \n -group scss-indent scss-indent-on-new-line
|
|
hook window InsertChar \} -group scss-indent scss-indent-on-closing-curly-brace
|
|
]
|
|
|
|
hook -group scss-highlight global WinSetOption filetype=(?!scss).* %{ remove-highlighter window/scss }
|
|
|
|
hook global WinSetOption filetype=(?!scss).* %{
|
|
remove-hooks window scss-indent
|
|
remove-hooks window scss-hooks
|
|
}
|