Fork me on GitHub
#lambdaisland
<
2024-04-24
>
Panel00:04:17

Hi fellow Corgi users, How could I setup my config to have a shortcut that will run (clj-reload.core/reload) in the current namespace ?

👀 1
💯 1
Panel01:04:34

Got it working, i added a (defun run-clj-reload ...) in my init (maybe not the best place) and added a signal and a key mapping. Easy ❤️

plexus15:04:18

for stuff like this I tend to just stick in a register

plexus15:04:51

we have an existing shortcut to run from a register

plexus15:04:55

;; use with ,,<letter>, e.g. `,,g' runs (user/go)
(set-register ?g "#_clj (user/go)")

plexus15:04:16

the #_clj is a hint, if you have both a clj and a cljs repl in the project, then this tells corgi it should use the clj repl

plexus15:04:38

I have these in my config

(set-register ?k "#_clj (do (require 'kaocha.repl) (kaocha.repl/run))")
(set-register ?K "#_clj (do (require 'kaocha.repl) (kaocha.repl/run-all))")
(set-register ?r "#_clj (do (require 'user :reload) (user/reset))")
(set-register ?g "#_clj (user/go)")
(set-register ?b "#_clj (user/browse)")
(set-register ?c "#_clj ((requiring-resolve 'nextjournal.clerk/serve!) {})")
(set-register ?, "#_clj (nextjournal.clerk/show! \"{{buffer-file-name}}\")")
(set-register ?p "#_clj (user/portal)")
(set-register ?P "#_cljs (user/portal)")

💯 1