Fork me on GitHub
Fabricio Cozzarolo01:10:39

Hello everyone! does anybody knows a shortcut of Calva or VSCode to jump with the cursor to the beginning of the current line? i know about cursorLineStart but it doesn't do what i want when the code is formatted and i'm on a line that is tabbed. For example, if i'm in the middle of the third line i want to jump to the begenning of default-style symbol (not the real beginning of the row, only where text starts):

(defn headers []
  (let [default-header-text-class "text-xs leading-4 font-medium tracking-wider text-left text-gray-500 uppercase "
        default-style {:padding-top    "12px"
                       :padding-left   "10px"
                       :padding-bottom "12px"}]))
and in second place, about shortcuts too.... is there any for trimming white spaces between words? i know the tab key solves it most of the time but occurs that when i want to disindent a line below the current one i press the del key and the line goes back up but it stays like this:
(defn headers []
  (let [default-header-text-class "text-xs leading-4 font-medium tracking-wider text-left text-gray-500 uppercase "
        default-style {:padding-top    "12px"                       :padding-left   "10px"
                       :padding-bottom "12px"}]
so i would like to trim whitespaces between "12px" and :padding-left (i don't know why tab key doesn't work here) Any help is welcome... and thanks in advance! :)


Calva uses a fork of, so you may find some help there. I’m not sure if that is possible with some cljfmt setting or not. @U0ETXRFEW probably knows more about this.


cljfmt doesn’t trim whitespace between things on the same line. For that particular case you can try the command Format and Align Current Form, but it also does other things so might not always be what you want.


For moving the cursor to where text starts on the line there is a VS Code command cursorHome on mac it is default bound to cmd+left.

Fabricio Cozzarolo13:10:40

cursorHomeworked perfect for me to jump to the beginning of the first word thanks! :), but Format and Align Current Form didn't, instead of trimming white spaces it returned :padding-left to the line below again


Ah, I didn’t figure that was not what you wanted. Anyway, that’s for the better. We might be removing that command soon. Maybe you can use Join next line (or whatever the command is named when you want to move :padding-left "10px" up. With the cursor somewhere on the default-style line. That would leave only one space, I think. (I might still be misunderstanding what you want to do of course. 😄)


cmd+j on mac, btw.

Fabricio Cozzarolo14:10:45

yes it worked 🙂 thank you very much.... the command is editor.action.joinLines


Welcome very much! Happy Friday!


hey can i get some help setting up calva with a dockerized lein repl?


i can connect to the nrepl server from within the editor, but it acts... weird?


it starts in the app.core namespace instead of user, and i can't seem to switch namespaces either


trying to run (println "hello") throws a syntax error at me saying it's Unable to resolve symbol: hello in this context


Have you loaded the file? Or any file?


what does "load the file" mean in calva?


i've opened the project's folder in vscode, the remote container thing started lein repl headless for me, and i connected


Load the file means to trigger the nrepl op load-file which in turn triggers a Clojure (load-file) (and some more, that I’m not completely sure what it is). It is needed to initialize the REPL to know about even core stuff. It’s mentioned here: and probably should be mentioned elsewhere as well.


> the remote container thing started lein repl headless for me, and i connected The REPL needs to be started with some dependencies met for Calva to work. There’s a command for copying out the command line that Calva would use to start the REPL, mentioned here


thanks! doing the key chord after connecting to the repl solved my issue.

metal 1

the syntax error above was different though, it's because for some reason when my repl prompt prints, there's a newline afterwards. unless i move to the line of the prompt, the syntax error above happens


no actually never mind the above, the syntax error thing with (println "hello") still happens, even if i "jack in" and calva installs the cider middleware and all that


aaaah never mind, figured it out. i was using ctrl+enter to execute while having the cursor inside the string


That makes sense. I think that in the REPL window we lose the decorations showing what has been evaluated.


I usually recommend people to not use the REPL window much at all for evaluating stuff. Calva embraces Rich Comments rather:


i think i'm missing some necessary step in the setup but can't seem to find what


You have a project with a repl running for it inside of a docker container, and you’re trying to connect Calva to the repl in the container, from outside the container?


I haven’t used a setup like that, but let’s see if someone else here has that can help out.


yes. the port is exposed and i can connect to it all right, but it acts weird


If you get no movement on this soon, feel free to create an issue with an example project and reproducible steps, including the docker details, and maybe we can help you figure it out.

👍 1

Hello. I’ve a question around shadow cljs. When I jack in I have the option to pick a build, so I end up picking frontend based on this config



 {:frontend {:target :browser
             :asset-path "/js"
             :output-path "/public/js"
             :modules {:main {:entries [main.core]}}}}}


However, despite doing so, I am unable to connect to a runtime. I have connected to the server by opening localhost:9630 on a browser


I’m a little unclear as to what needs to be done.


1. Jack in
2. Select a build
3. Hit localhost:9630
4. ....


9630 is shadow’s UI, iirc?


You’ll need to open the app you are building.


that’s open too


You might need to reload it.


Check its console output for any errors as well.


I think I’ll try the dev-http option instead of doing it manually


What’s the dev-http option?


Shadow lets you specify an additional option that launches a file server


reloading worked. Not sure what the problem was


dev-http works too. Quite convenient as well


Ah, that one. 😃 It’s what I usually start with as well.


If I select a browser-repl build though, it does connect to the runtime