This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-04
Channels
- # announcements (9)
- # babashka (5)
- # beginners (50)
- # calva (13)
- # clj-kondo (11)
- # clojure (30)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (4)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-norway (2)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojurescript (32)
- # conjure (2)
- # honeysql (1)
- # hyperfiddle (8)
- # jobs-discuss (9)
- # leiningen (2)
- # malli (3)
- # off-topic (21)
- # reitit (4)
- # shadow-cljs (10)
- # sql (3)
- # squint (17)
- # tools-deps (14)
To take advantage of a user.clj
file to prepare a dev environment (e.g. require useful dev namespaces like clojure.repl
), and then to work from within that.
Actually, thinking through this a bit, it seems like it would be very difficult to work out what should eval in the editor file's namespace, and what should eval under user. :thinking_face:
I guess the obvious solution here is to just keep the user.clj
file open for use as repl input.
Seems like it could work decently to have a key-chord prefix that changes eval to user. i.e.
Alt + Enter
-> Evaluate top level form
Ctrl + Alt + C , Alt + Enter
-> Evaluate top level form in user namespace
Maybe Ctrl + Alt + U ...
to indicate "user". Doesn't seem to be anything that shortcut in a default Code setup.
Aside from the initial dev setup, isn't most of the code you're evaluating going to be in different namespaces?
You can define a custom repl command like so:
"calva.customREPLCommandSnippets": [
{
"name": "Eval Current Form in user NS",
"key": "eval-current-form-in-user-ns",
"ns": "user",
"snippet": "$current-form"
},
Then a keybinding like so:
{
"key": "ctrl+alt+u alt+enter",
"command": "calva.runCustomREPLCommand",
"args": "eval-current-form-in-user-ns"
}
(You can of course pick a shorter key, like ecfu
or something 😄 )I've now pushed a PR which allows for defining keyboard shortcuts to ”unregistered” custom repl commands. • Description of change: https://github.com/BetterThanTomorrow/calva/issues/1853 • VSIX (please consider helping with testing it): https://output.circle-artifacts.com/output/job/8ffb18f8-98a0-4f70-84c3-935b54769010/artifacts/0/tmp/artifacts/calva-2.0.299-1853-shortcut-repl-snippets-ecced4a7.vsix
I've now pushed a PR which allows for defining keyboard shortcuts to ”unregistered” custom repl commands. • Description of change: https://github.com/BetterThanTomorrow/calva/issues/1853 • VSIX (please consider helping with testing it): https://output.circle-artifacts.com/output/job/8ffb18f8-98a0-4f70-84c3-935b54769010/artifacts/0/tmp/artifacts/calva-2.0.299-1853-shortcut-repl-snippets-ecced4a7.vsix