From 5da00a0f1413cff305ea309a0915ddf3f3b36df4 Mon Sep 17 00:00:00 2001 From: Alex Leferry 2 Date: Thu, 26 Nov 2015 15:23:02 +0100 Subject: [PATCH] add rc/grench.kak --- src/rc/grench.kak | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/rc/grench.kak diff --git a/src/rc/grench.kak b/src/rc/grench.kak new file mode 100644 index 000000000..1f4b3c2ed --- /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 :grench +}