kakoune/rc/extra/scss.kak

46 lines
1.3 KiB
Plaintext
Raw Normal View History

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