1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-29 10:02:57 +03:00
kakoune/rc/extra/scss.kak

49 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-07-21 03:00:59 +04:00
# http://sass-lang.com
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# require css.kak
# Detection
# ‾‾‾‾‾‾‾‾‾
hook global BufCreate .*[.](scss) %{
set buffer filetype scss
}
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
2017-02-01 15:56:24 +03:00
add-highlighter -group / regions -default core scss \
comment // $ ''
2014-07-21 03:00:59 +04:00
2017-02-01 15:56:24 +03:00
add-highlighter -group /scss/comment fill comment
2014-07-21 03:00:59 +04:00
2017-02-01 15:56:24 +03:00
add-highlighter -group /scss/core ref css
add-highlighter -group /scss/core regex @[A-Za-z][A-Za-z0-9_-]* 0:meta
2014-07-21 03:00:59 +04:00
# 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
2014-07-21 03:00:59 +04:00
# Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
2017-01-04 03:07:45 +03:00
hook -group scss-highlight global WinSetOption filetype=scss %{ add-highlighter ref scss }
2014-07-21 03:00:59 +04:00
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
2014-07-21 03:00:59 +04:00
]
2017-01-04 03:07:45 +03:00
hook -group scss-highlight global WinSetOption filetype=(?!scss).* %{ remove-highlighter scss }
2014-07-21 03:00:59 +04:00
hook global WinSetOption filetype=(?!scss).* %{
2017-01-04 03:07:45 +03:00
remove-hooks window scss-indent
remove-hooks window scss-hooks
2014-07-21 03:00:59 +04:00
}