summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rc/grench.kak17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/rc/grench.kak b/src/rc/grench.kak
new file mode 100644
index 00000000..1f4b3c2e
--- /dev/null
+++ b/src/rc/grench.kak
@@ -0,0 +1,17 @@
+# http://leiningen.org/grench.html
+# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+
+def grench -docstring 'eval selection with Grench/Leiningen' %{ %sh{
+
+ if ! grench eval ''; then
+ echo "echo 'auto launching headless Leiningen REPL'"
+ ( lein repl :headless ) > /dev/null 2>&1 < /dev/null &
+ while ! grench eval '' > /dev/null 2>&1; do continue; done
+ fi
+ }
+ info -anchor "%val(cursor_line).%val(cursor_column)" %sh{ grench eval "$kak_selection" }
+}
+
+hook global WinSetOption filetype=clojure %{
+ map buffer normal <ret> :grench<ret>
+}