Fork me on GitHub
#cursive
<
2021-05-17
>
roklenarcic12:05:05

Is there some way to make your run configuration automatically use deps aliases selected in deps tab?

roklenarcic12:05:55

This requires me to name every single alias, and it might be out of sync with what I have selected in my deps tab

imre13:05:58

@roklenarcic 'run with intellij classpath'

roklenarcic13:05:30

Thanks, I guess in the past I was using it in a way that didn’t work for me

imre14:05:03

I think I sometimes need to do a 'refresh deps projects' after changing what's ticked in the list for ij to pick those changes up

octahedrion13:05:49

why is that some namespace aliases don't show their symbols in autocomplete ?

cfleming03:05:01

They should all do, do you have an example of one that doesn’t?

octahedrion14:05:15

yes e.g. if I (require '[clojure.tools.namespace.parse :as np]) I don't get any autocomplete for (np/) whereas if I do for (clojure.tools.namespace.parse/)

octahedrion10:05:32

what's stranger is that I sometimes get autocomplete for a completely different namespace. For example I have required datomic.client.api :as d but when I ctrl-space for (d/) I get completions for kixi.stats.distribution

cfleming22:05:57

Does File -&gt; Invalidate Caches and Restart help this? It sounds to me like your indexes are funky somehow.

cfleming23:05:36

Also, which version of IntelliJ are you on? If you’re on 2021.1 and haven’t upgraded to 2021.1.1 yet, I think they had a bunch of indexing bugs which were fixed in the point release.

octahedrion08:05:14

I tried invalidate caches & restarting but same problem. It happens with one project and not another. I suspect it's because I'm using libraries in my REPL from ~/.clojure/deps.edn which are not in my project's deps.edn

raspasov14:05:52

Does anybody know if there’s a way to “cycle” through a number of commands in IntelliJ ?

raspasov14:05:02

(I know there’s specific commands to cycle through some items, but I think a generic “cycle” that is you define can be useful)

imre14:05:36

like a macro?

imre14:05:03

if it's the same n commands you want to cycle through in the same order, then you could record a macro

raspasov14:05:17

Yes, I know macros, but they always run all the commands from start to finish. As I typed this, I realized it’s probably harder to implement in practice that I initially thought.

raspasov14:05:47

My idea was to replicate the “Alt+Tab” experience in say, MacOS where it jumps to the previous active window.

raspasov14:05:22

For example, if you cycle: “Jump to REPL Editor” “Focus Editor” … you’d be able to assign one shortcut to those and that would be convenient. But I realize that it’s hard to do, because IntelliJ has to keep the state of where the focus is at the moment.

raspasov14:05:07

Not “hard” but not super trivial like I thought for the first 30 seconds 🙂

imre14:05:50

there's a Jump to Last Tool Window command

imre14:05:52

and esc puts you back in the editor

imre14:05:01

if that's your usecase

raspasov14:05:27

Oh, I know 🙂

raspasov14:05:21

The Escape is too annoying to hit because of Apple keyboard decisions 😂 (first world problems)

imre14:05:51

I guess I hit my limit of knowledge then 🙂

imre14:05:08

but I also think esc can be rebound to something more convenient

raspasov14:05:37

I tried that, for some reason it does not work reliably (at all?)

raspasov14:05:59

For example, if I add an additional shortcut in Keymap for “Escape” it actually doesn’t jump back to source, for example. So it’s weird.

raspasov14:05:21

Hence my “cycle shortcuts” idea 😆

raspasov14:05:59

In any case, I added two different shortcuts, CMD+1, CMD+2 for those two commands. It works fine.

raspasov14:05:13

I am just complaining. Back to work! 🙂

Phil Shapiro15:05:46

Not sure it’ll help you, but I use Find Action for tasks like this all the time. I hit command-shift-a to bring it up, type a few letters to select the command, and hit return. Much faster than using the mouse.

raspasov20:05:00

@UQL85PT29 For sure. I try to eliminate most mouse “activity”.

raspasov20:05:28

In actions that I do on a daily/hourly basis.

cfleming03:05:58

I think you’re right that cycling is hard to do in a general way because it often depends on the current state. I went through a long bout of soul-searching on this with the REPL jumping commands, i.e. should there be one that cycles between input, output and code editor, or should there be 3 absolute jumps? In the end I decided on the absolute jumps. In my case since I’m implementing the command determining the current state is not hard, but the user still has to mentally take the current state into account when using the command, and in the end I decided it was more predictable to have absolutes.

raspasov22:05:38

@U0567Q30W Thanks for the input! I think specifically the switch between editor and input is super common and there will be very little overhead of keeping track of where I am at the moment. Perhaps it makes sense to add a separate action if it’s easy on your side to determine the current state. “Switch between REPL input and code editor” or something like that. But if you want to keep them only separate, I understand. It’s not a huge difference, still works well enough for my use case.

Mateusz Mazurczak20:05:44

Has anybody here switched from emacs/vim to cursive? What did you like more?

thheller20:05:57

I switched from emacs when cursive first came out. never going back 😛

💥 6
Mateusz Mazurczak21:05:07

What made you stay with cursive or move out of emacs?

thheller21:05:52

got tired of my emacs config breaking and having to configure every little thing manually

thheller21:05:01

cursive just works and does what I want

thheller21:05:54

(I also have used IntelliJ for many years before in my Java days so it was an easy choice)

Mateusz Mazurczak21:05:47

I guess I’m in a similar position as you back then, thank you for your feedback