From fce9d1804103ef5a62ba332b9508de082cc39920 Mon Sep 17 00:00:00 2001 From: Alex Leferry 2 Date: Mon, 21 Jul 2014 01:00:59 +0200 Subject: [PATCH] add rc/scss.kak --- rc/scss.kak | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 rc/scss.kak diff --git a/rc/scss.kak b/rc/scss.kak new file mode 100644 index 00000000..e52e4d22 --- /dev/null +++ b/rc/scss.kak @@ -0,0 +1,48 @@ +# http://sass-lang.com +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +# require css.kak + +# Detection +# ‾‾‾‾‾‾‾‾‾ + +hook global BufSetOption mimetype=text/x-scss %{ + set buffer filetype scss +} + +hook global BufCreate .*[.](scss) %{ + set buffer filetype scss +} + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +addhl -group / group scss + +addhl -group /scss ref css + +addhl -group /scss 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 global WinSetOption filetype=scss %[ + addhl ref 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 global WinSetOption filetype=(?!scss).* %{ + rmhl scss + rmhooks window scss-indent + rmhooks window scss-hooks +}