kakoune/rc/base/clojure.kak
Maxime Coste d49555fc75 Move highlighters into Scopes
That means we can now have highlighters active at global, buffer, and
window scope. The add-highlighter and remove-highlighter syntax changed
to take the parent path (scope/group/...) as a mandatory argument,
superseeding the previous -group switch.
2017-10-28 13:43:04 +08:00

43 lines
1.2 KiB
Plaintext

# http://clojure.org
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# require lisp.kak
# Detection
# ‾‾‾‾‾‾‾‾‾
hook global BufCreate .*[.](cljs?) %{
set buffer filetype clojure
}
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/ group clojure
add-highlighter shared/clojure ref lisp
add-highlighter shared/clojure regex \b(clojure.core/['/\w]+)\b 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 -group clojure-highlight global WinSetOption filetype=clojure %{ add-highlighter window ref clojure }
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
]
hook -group clojure-highlight global WinSetOption filetype=(?!clojure).* %{ remove-highlighter window/clojure }
hook global WinSetOption filetype=(?!clojure).* %{
remove-hooks window clojure-indent
remove-hooks window clojure-hooks
}