2014-07-21 01:00:59 +02:00
|
|
|
# http://sass-lang.com
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
# require css.kak
|
|
|
|
|
|
|
|
# Detection
|
|
|
|
# ‾‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
hook global BufCreate .*[.](scss) %{
|
2017-11-03 08:34:41 +01:00
|
|
|
set-option buffer filetype scss
|
2014-07-21 01:00:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Highlighters
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/scss regions
|
|
|
|
add-highlighter shared/scss/core default-region group
|
2018-07-02 12:59:12 +02:00
|
|
|
add-highlighter shared/scss/comment region // $ fill comment
|
2014-07-21 01:00:59 +02:00
|
|
|
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/scss/core/ ref css
|
|
|
|
add-highlighter shared/scss/core/ regex @[A-Za-z][A-Za-z0-9_-]* 0:meta
|
2014-07-21 01:00:59 +02:00
|
|
|
|
|
|
|
# Commands
|
|
|
|
# ‾‾‾‾‾‾‾‾
|
|
|
|
|
2018-12-19 10:10:26 +01:00
|
|
|
define-command -hidden scss-trim-indent css-trim-indent
|
2017-11-03 08:34:41 +01:00
|
|
|
define-command -hidden scss-indent-on-new-line css-indent-on-new-line
|
|
|
|
define-command -hidden scss-indent-on-closing-curly-brace css-indent-on-closing-curly-brace
|
2014-07-21 01:00:59 +02:00
|
|
|
|
|
|
|
# Initialization
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2018-11-28 10:39:18 +01:00
|
|
|
hook -group scss-highlight global WinSetOption filetype=scss %{
|
|
|
|
add-highlighter window/scss ref scss
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/scss }
|
2018-11-28 10:39:18 +01:00
|
|
|
}
|
2014-07-21 01:00:59 +02:00
|
|
|
|
2016-09-25 15:15:07 +02:00
|
|
|
hook global WinSetOption filetype=scss %[
|
2018-12-19 10:10:26 +01:00
|
|
|
hook window ModeChange insert:.* -group scss-trim-indent scss-trim-indent
|
2017-01-13 01:56:30 +01:00
|
|
|
hook window InsertChar \n -group scss-indent scss-indent-on-new-line
|
|
|
|
hook window InsertChar \} -group scss-indent scss-indent-on-closing-curly-brace
|
2018-11-28 08:13:55 +01:00
|
|
|
set-option buffer extra_word_chars '_' '-'
|
2016-09-28 08:45:01 +02:00
|
|
|
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window scss-.+ }
|
2018-11-28 10:39:18 +01:00
|
|
|
]
|