lambdaisland

Panel 2024-04-24T00:25:17.774149Z

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
Panel 2024-04-24T01:13:34.872229Z

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 ❤️

plexus 2024-04-24T15:10:18.897979Z

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

plexus 2024-04-24T15:10:51.387149Z

we have an existing shortcut to run from a register

plexus 2024-04-24T15:10:55.762489Z

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

plexus 2024-04-24T15:11:16.119269Z

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

plexus 2024-04-24T15:11:38.229519Z

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