kakoune/rc/base/clojure.kak

43 lines
1.2 KiB
Plaintext
Raw Normal View History

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?) %{
set-option buffer filetype clojure
2014-07-21 01:10:01 +02:00
}
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/ group clojure
2014-07-21 01:10:01 +02:00
add-highlighter shared/clojure ref lisp
2014-07-21 01:10:01 +02:00
add-highlighter shared/clojure regex \b(clojure.core/['/\w]+)\b 0:keyword
2014-07-21 01:10:01 +02:00
# Commands
# ‾‾‾‾‾‾‾‾
define-command -hidden clojure-filter-around-selections lisp-filter-around-selections
define-command -hidden clojure-indent-on-new-line lisp-indent-on-new-line
2014-07-21 01:10:01 +02:00
# Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group clojure-highlight global WinSetOption filetype=clojure %{ add-highlighter window ref clojure }
2014-07-21 01:10:01 +02:00
hook global WinSetOption filetype=clojure %[
hook window ModeChange insert:.* -group clojure-hooks clojure-filter-around-selections
hook window InsertChar \n -group clojure-indent clojure-indent-on-new-line
2014-07-21 01:10:01 +02:00
]
hook -group clojure-highlight global WinSetOption filetype=(?!clojure).* %{ remove-highlighter window/clojure }
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
}