2014-07-21 01:10:01 +02:00
|
|
|
# http://clojure.org
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
# require lisp.kak
|
|
|
|
|
|
|
|
# Detection
|
|
|
|
# ‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2015-06-06 11:41:47 +02:00
|
|
|
hook global BufCreate .*[.](cljs?) %{
|
2014-07-21 01:10:01 +02:00
|
|
|
set buffer filetype clojure
|
|
|
|
}
|
|
|
|
|
|
|
|
# Highlighters
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group / group clojure
|
2014-07-21 01:10:01 +02:00
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group /clojure ref lisp
|
2014-07-21 01:10:01 +02:00
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group /clojure regex \b(clojure.core/['/\w]+)\b 0:keyword
|
2014-07-21 01:10:01 +02:00
|
|
|
|
|
|
|
# Commands
|
|
|
|
# ‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
def -hidden _clojure_filter_around_selections _lisp_filter_around_selections
|
|
|
|
def -hidden _clojure_indent_on_new_line _lisp_indent_on_new_line
|
|
|
|
|
|
|
|
# Initialization
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
2017-01-04 01:07:45 +01:00
|
|
|
hook -group clojure-highlight global WinSetOption filetype=clojure %{ add-highlighter ref clojure }
|
2014-07-21 01:10:01 +02:00
|
|
|
|
|
|
|
hook global WinSetOption filetype=clojure %[
|
|
|
|
hook window InsertEnd .* -group clojure-hooks _clojure_filter_around_selections
|
|
|
|
hook window InsertChar \n -group clojure-indent _clojure_indent_on_new_line
|
|
|
|
]
|
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
hook -group clojure-highlight global WinSetOption filetype=(?!clojure).* %{ remove-highlighter clojure }
|
2016-09-28 08:45:01 +02:00
|
|
|
|
2014-07-21 01:10:01 +02:00
|
|
|
hook global WinSetOption filetype=(?!clojure).* %{
|
2017-01-04 01:07:45 +01:00
|
|
|
remove-hooks window clojure-indent
|
|
|
|
remove-hooks window clojure-hooks
|
2014-07-21 01:10:01 +02:00
|
|
|
}
|