This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-12
Channels
- # announcements (5)
- # babashka (1)
- # beginners (193)
- # calva (79)
- # cider (18)
- # clara (4)
- # clojure (38)
- # clojure-europe (12)
- # clojure-france (8)
- # clojure-nl (12)
- # clojure-sweden (1)
- # clojure-uk (50)
- # clojurescript (37)
- # conjure (30)
- # cursive (3)
- # data-science (2)
- # datalog (7)
- # datomic (12)
- # events (2)
- # expound (3)
- # figwheel-main (1)
- # fulcro (45)
- # graalvm (1)
- # jobs (1)
- # jobs-discuss (11)
- # luminus (1)
- # malli (5)
- # off-topic (32)
- # reagent (6)
- # reitit (32)
- # shadow-cljs (25)
- # spacemacs (2)
- # sql (22)
- # vim (6)
Hey Calva friends. I've (re)implemented repl command history for the new output/repl window. It works the same as with the old repl window. alt+up
to go previous history, alt+down
to go next history.
These shortcuts are only overidden in the repl window (in normal editors they map to move line up/down).
Please give this vsix a spin and let us know if you see any issues. It contains 1 or 2 other changes on dev as well, including @cb.lists's fix for not overriding the default binding for esc
. https://7490-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.120-fix-740-allow-default-esc-keybind-feature-add-repl-history-021e2239.vsix
Nice! Two things I notice:
1. When I send a form to the repl from another file, it seems to kill the history.
2. alt+up/down
completely replaces the move line up down built-in command. I know structural autists frown on me using that a lot, but I do.
I think it is cool that we use such an accessible shortcut, but also that it should only work as the history shortcut when the cursor is behind the last form in the file (or the last prompt, if no form has been entered).
Thanks, I'll look into the history killing issue. Yeah I was considering this with the shortcut, but I thought I remembered discussing before that if this is only the case in the output window then it's not a big deal. I'll see about detecting the position of the cursor when the command is issued, and deferring to the move line commands if not after the last prompt
I think we can detect cursor position and update a when
context in a selectionChanged
observer/watcher.
I might convert ... https://twitter.com/borkdude/status/1293527889690988544



Just switched to latest Calva with the new REPL window and it’s quite nice 👍 Had to change some habits, but after a few hours productivity is up again. Thank you @pez!

The new repl window also has a prompt, right? What I am driving at is Rich comments: https://betweentwoparens.com/rich-comment-blocks#rich-comment
Ah yes, it has a prompt. In the old REPL window it behaved more like a prompt because of the arrow keys navigation. The new one behaves more like a file which I like
I really like that the REPL window behaves more like a normal file editor now. I can place a cursor at any previous expression and eval it many times in a row. Previously I’d have to use the arrow keys to go previous expressions, which could be tedious if you want to go even 3 steps back
Nice to hear people are seeing the benefits! I'm working on adding the history navigation at the prompt back, just as an added feature to what you mention above, because some users really wanted it 😄
My understanding is that the editor itself is open source but extensions for remote editing, WSL, Docker, etc., are proprietary.
Does clj::proj.core
mean: clojure, proj.core namespace? In CLJS you would get cljs::proj.core
?
the prefix just says which repl you are connected to. In Calva there is only one or two repl’s per workspace/window. So in a clj+cljs project you are either connected to the clj repl or to the cljs repl.
At work I have a multi-repo where I need to be connected to two Clojure REPLs sometimes
“Ajajaj” sounds oddly Swedish. Dutch? 😃 Anyway, yes, there is https://github.com/BetterThanTomorrow/calva/issues/76
Yeah, two windows. This is written by someone who doesn’t really understand the multirepo concept, but anyway: https://calva.io/workspace-layouts/
For me the most pressing need for one more REPL connection is that I want a babashka REPL always handy. 😃
My goal in my application for clojurists together this quarter is to add multi-project/repl support to Calva 😄 . Want to add this anyway but the funding will help speed things up.
Can you change the keybinding of forward slurp? I'd like to keep my mission control keybindings
Now I hope the SSH remote plugin will be free and around forever (open source fears)
There is also Theia, which I think might help in keeping MS taking the right decisions. 😃
No. That would be nice. I think @slack1038 had it a branch there a long while ago...
> ctrl+shift+alt+up Select Backward Down Sexp > ctrl+shift+alt+down Select Forward Up Sexp makes sense right?
The use case:
(deftest datafy-test
(prn (tu/bb nil "(require '[clojure.datafy :as d]) (:flags (d/datafy Exception))")))
I'm editing the code inside the string. In emacs forward slurp etc. work.Does Calva have completions when connected to an nREPL server? It seems that it doesn't work?
I think I have screwed up a couple of default keybindings. Is there a way to restore them? ;)
I guess i can look them up here: https://github.com/BetterThanTomorrow/calva/blob/db449d690e8032c4bfedc22c4fc54c344c5a95e9/package.json#L1067
But guess what. I helped out someone at an online meetup tonight what was trying to evaluate something in the Calva output window.
The output window should work the same, though. alt+enter
and ctrl+enter
. If it didn't, then there is a bug somewhere.
Getting the hang of it. So far my missing features are: undo-tree (which isn't on Calva, but VSCode in general) and structural editing in strings.
Consider this one:
(deftest datafy-test
(testing "default implementation of datafy works"
(is (= #{:public} (bb "(require '[clojure.datafy :as d]) (:flags (d/datafy Exception))"))))
(testing "custom implementation of datafy works"
(is (= {:number 1} (bb "
(require '[clojure.datafy :as d]
'[clojure.core.protocols :as p])
(extend-type Number
p/Datafiable
(datafy [x]
{:number x}))
(d/datafy 1)
"))))
(testing "default implementation of nav works"
(is (= #{:public} (bb "(require '[clojure.datafy :as d]) (:flags (d/datafy Exception))")))))
It could be made something that can be toggled. I really want it to behave like it does. But if I do have a case where I want help with lisp editing inside a string, that would be nice to toggle on.
Surprisingly when I edit a file in emacs tramp via ssh, it's picked up in the Remote SSH plugin immediately, so missing features I can do in emacs, although it would be nice to have them all in one editor
> But if I do have a case where I want help with lisp editing inside a string Well, I do that all the time in the tests for babashka and sci.
I see, it wants to indent the entire string according to the first quote's indentation. This is not what emacs does, so now I'm stuck between two different modes ;)
A new vsix for the repl history feature: https://7515-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.120-fix-740-allow-default-esc-keybind-feature-add-repl-history-158338ca.vsix Please give it a whirl.

Works nice for me 👍