From ce1bc291ce60104f91af92d87248729cc1faf44b Mon Sep 17 00:00:00 2001 From: Alex Leferry 2 Date: Mon, 21 Jul 2014 01:10:01 +0200 Subject: [PATCH] add rc/clojure.kak --- rc/clojure.kak | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 rc/clojure.kak diff --git a/rc/clojure.kak b/rc/clojure.kak new file mode 100644 index 000000000..fd4afb3c2 --- /dev/null +++ b/rc/clojure.kak @@ -0,0 +1,46 @@ +# http://clojure.org +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +# require lisp.kak + +# Detection +# ‾‾‾‾‾‾‾‾‾ + +hook global BufSetOption mimetype=text/x-clojure %{ + set buffer filetype clojure +} + +hook global BufCreate .*[.](clj) %{ + set buffer filetype clojure +} + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +addhl -group / group clojure + +addhl -group /clojure ref lisp + +addhl -group /clojure regex \<(clojure.core/['/\w]+)\> 0:keyword + +# Commands +# ‾‾‾‾‾‾‾‾ + +def -hidden _clojure_filter_around_selections _lisp_filter_around_selections +def -hidden _clojure_indent_on_new_line _lisp_indent_on_new_line + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +hook global WinSetOption filetype=clojure %[ + addhl ref clojure + + hook window InsertEnd .* -group clojure-hooks _clojure_filter_around_selections + hook window InsertChar \n -group clojure-indent _clojure_indent_on_new_line +] + +hook global WinSetOption filetype=(?!clojure).* %{ + rmhl clojure + rmhooks window clojure-indent + rmhooks window clojure-hooks +}