aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hammerspoon/.hammerspoon/init.fnl18
1 files changed, 17 insertions, 1 deletions
diff --git a/hammerspoon/.hammerspoon/init.fnl b/hammerspoon/.hammerspoon/init.fnl
index 3aa6b4f..ada9884 100644
--- a/hammerspoon/.hammerspoon/init.fnl
+++ b/hammerspoon/.hammerspoon/init.fnl
@@ -97,6 +97,22 @@
(let [watcher (make-mouse-watcher)]
(watcher:start))
-;; Done
+;;; Fennel Repl
+
+(local fennel (require :fennel))
+
+(let [coro (coroutine.create (. fennel :repl :repl))]
+ (coroutine.resume coro {:readChunk (fn []
+ (let [input (coroutine.yield)]
+ (.. input "\n")))
+ :onValues (fn [xs]
+ (print (table.concat xs "\t")))
+ :onError (fn [_ msg]
+ (print msg))})
+ (set hs._consoleInputPreparser (fn [s]
+ (coroutine.resume coro s)
+ "")))
+
+;;; Done
(hs.alert.show "Loaded!" [] (hs.screen.primaryScreen) 0.5)