Fork me on GitHub
#cursive
<
2020-05-01
>
dpsutton00:05:30

are there any vim emulation and cursive users? seems the navigation gets a little awkward when in normal mode.

cfleming00:05:36

There are, but since I don’t use it I’m not really sure what the state is. There’s some info in the wiki here: https://github.com/cursive-ide/cursive/wiki/IdeaVim-issues and here: https://github.com/cursive-ide/cursive/wiki/Mapping-IdeaVim-actions-to-Cursive-actions

cfleming00:05:38

That’s a bit out of date actually, looking at it now. As of IntelliJ 2019.3 the action to return from the toolwindow to the editor can be remapped from ESC.

cfleming00:05:09

@U07S8JGF7 Any comments about the wiki sections there? Anything that would be useful to add, or which is no longer relevant?

potetm00:05:56

Well, before I say anything, keep in mind my cursive bindings were hand-set and they’re very different from the defaults and from emacs mode.

potetm00:05:59

afaik https://github.com/cursive-ide/cursive/issues/384 isn’t a problem (and I don’t even recall whether it actually was)

potetm00:05:57

re: https://github.com/cursive-ide/cursive/issues/1249 I mean, yes, technically. But this is completely intuitive for me. I would be a little mad if it weren’t the case.

potetm00:05:35

And, yeah, still highly recommend re-training yourself to do ctrl-[.

potetm00:05:48

Yeah for the most part, pretty accurate. I can’t think of anything else.

cfleming00:05:35

Yeah, I’m not sure whether it would be worthwhile trying to rebind the built-in IdeaVim commands to sexp-aware alternatives, or add new ones.

cfleming00:05:59

It seems like parinfer is a good solution for that problem, and Shawn is a vimmer I believe.

potetm00:05:43

Yeah, I personally hate two-stroke sexpr movement/editing. So I might not be the target audience for that kind of change.

cfleming00:05:48

Fair enough. I guess as long as people can configure things how they want them (which is increasingly the case) then I’m happy.

truestory 1
potetm00:05:20

@dpsutton Any issues in particular? I use ideavim and cursive together all the time.

potetm00:05:19

There is some weirdness, but most of it’s infrequent enough that I chalk it up to fat fingers

dpsutton00:05:28

for instance here. the cursor is at the end of the line and the opening paren is highlighted. but if i hit cmd-left i end up at the opening paren at loop

potetm00:05:18

cmd-left ? what vim mode you using??? troll

dpsutton00:05:34

i don't know the vim command for beginning of defun or backwards-sexp

dpsutton00:05:52

i'm gently learning cursive and my hands have 6 years of emacs in them

flowthing09:05:27

Somewhat off-topic, but I was wondering what's driving you from Emacs to Cursive? Just asking because I'm currently headed the other way. 🙂

nmkip15:05:37

I'd like to know that too

dpsutton15:05:29

I'm not sure driving is the right word. I'm incredibly comfortable in emacs and will use it. I have not needed heavy (or really any) java interop so the lack of the power of Intellij with java hasn't been a hindrance. But there's some polish that intellij has which emacs lacks. I'm also kinda drawn to a simpler repl without nrepl and let static tooling drive the code. Seems nice to crank up a very simple repl and then let cursive do all of its autocomplete and documentation and popups. I'm not sure this is grounded in reality however. I know there's lots of stuff going on under the hood for cursive and to get a good cljs experience it seems like its either nrepl based or tubular based which doesn't really remove any complexity. I think maybe my ideal setup would be cursive's smarts and inf-clojure's simpleness of just running a repl with a bit of font-locking

flowthing07:05:05

Thanks! Coming from the other direction, what you said definitely resonates. For me, static analysis is Cursive's biggest strength. Java interop, ease of use, and close(r) integration with the operating system are next on the list. What's pushing me toward Emacs is that at least for me, IDEA is prone to slowdowns and UI freezes. Moreover, it seems that they break their APIs quite often, making every IDEA update a somewhat risky proposition for Cursive users. I guess I also just wanted to see whether the grass is greener on the other side. I think static analysis is going to drive me back to Cursive sooner or later, but I think I'll give Emacs at least a couple of weeks before that. I might even write up an experience report on this topic if I get around to it.

dpsutton00:05:40

so just learning a few movements and basics for now. but the structural movements and vim don't seem to align here. i can't get the cursor far enough such that the structural movement takes be to the beginning

potetm00:05:46

Alternatively, you can use Cursive bindings: Navigate -> structural movement -> move backward (or move backward out of sexp)

potetm00:05:32

Ah okay. So, generally speaking, cursive and ideavim are two different control sets. You can map vim actions to cursive (see https://github.com/cursive-ide/cursive/wiki/Mapping-IdeaVim-actions-to-Cursive-actions) if you like, but I highly recommend mapping paredit to single keystrokes.

dpsutton00:05:24

yeah i figured. i need to learn how to get a vimrc or equivalent set up here. but was trying to learn the basics and navigation. i figure for a bit i'll just learn go to's, return from goto, and structural navigation along with the standard vanilla vim movements (already know these just been a while since i've used them)

potetm00:05:57

Yeah, I’ve kinda wired my brain so that for code changes, I’m in cursive-mode. (This is most of the time.) If I’m in vim mode, I’ve fallen back to character-bashing mode.

dpsutton01:05:50

one question. i seem to get this view where there aren't any windows and it seems to be in an invalid state. am i doing something wrong? I just hit open project and end up in this state.

kenny01:05:10

Omg I've had this happen every once in a while too! I think it's from accidentally hitting some key combo that hides all the windows.

cfleming10:05:28

Yes, that one is very strange. I’ve seen that one myself occasionally recently (only under 2020.1, perhaps?) but I’ve never managed to reproduce it reliably.

cfleming10:05:54

@UDCGPTV9R Does that happen always for you?

salam19:05:04

yep, constantly reproducible.

salam19:05:36

it seems like it’s either cursive or intellij idea that’s doing some work that’s not supposed to be on Swing’s event dispatch thread and an assertion on that is blowing everything up (as can be seen in the log attached to the github issue.)

cfleming22:05:34

Ok, I’ll look at that, thanks.

1
dpsutton01:05:13

i close the window and then open the project again and everything seems to be back to normal

AJ Jaro13:05:34

@cfleming Thanks for all of your work on Cursive, it’s definitely a great tool! This particular issue, however, is really a struggle for my team. Is there a way to help prioritize this task or a way that we can help resolve it? https://github.com/cursive-ide/cursive/issues/2233 We do appreciate the tool you’ve built and want to continue supporting you as best we can. Let us know how we can help.

2
cfleming22:05:05

I’ll take a look at this and see if I can figure this out.

cfleming04:05:49

Ok, this is fixed for the next EAP. It was surprisingly tricky, keywords are complicated things in Cursive these days. But I think this should now be working correctly, hopefully without affecting anything else.

👍 1
flowthing09:05:54

Fantastic to hear that this will be fixed, thank you very much! This feature is a lifesaver when working on a re-frame project. :thumbsup:

AJ Jaro15:05:01

Wow! Great! Thanks a bunch @cfleming

cfleming10:05:13

This is out now in 1.9.2-eap2, let me know if it’s not working as you expect!

🎉 1
AJ Jaro12:05:31

@cfleming This is fantastic! Thanks a ton for expediting this fix. I’m about to tell our whole team it’s so exciting!

Ben Grabow21:05:39

Sometimes Cursive will give me autocomplete suggestions when I am adding a dependency to my leiningen project. I love when this happens! It means I don't need to lookup the exact maven group, artifact, and id. However usually this autocomplete suggestion thing doesn't work at all, and I can't figure out why it occasionally works and why it doesn't. Seems like maybe at some point I upgraded version and it stopped working? Does anyone else see this?

Ben Grabow21:05:41

I'm on Intellj IDEA Ultimate 2020.1 and Cursive 1.9.2-eap1-2020.1

Ben Grabow21:05:50

I have maven central, clojars, a couple private corporate nexus repos, and my local m2 in my list of Indexed Maven Repositories and they all have been indexed in the last two weeks.

cfleming22:05:18

Does it fail consistently now on your current version, or is it intermittent?

Ben Grabow23:05:36

Consistently. I don't often restart the whole ide or restart my computer, but I can't remember it working since I upgraded last.

Ben Grabow23:05:14

I also can't remember the last time it did work, so it might not just be this version.

folcon00:05:08

I’ve had this happen to me as well =)… I thought that it might be because my repos were out of date, but I just updated them and no luck.

Eddie21:05:32

Does Cursive + deps.edn have an equivalent of SBT's withSources()?

Eddie21:05:42

For the non-scala folks, here is what I am talking about: https://www.scala-sbt.org/0.13.2/docs/Detailed-Topics/Library-Management.html#download-sources Scala devs using SBT can add withSources() to their dependency declarations to download source JARs. Scala IDE plugins use this to allow you to read the source of your dependencies from right within the editor.

alexmiller21:05:13

most clojure deps do not publish a sources jar (because the sources are in the main jar, b/c clojure libs usually aren't compiled)

Eddie21:05:03

Thanks @alexmiller. That makes sense. I am actually hoping to use this for Java and Scala projects that I am using via interop. I can understand that the community might be less interested in supporting this because most deps are Clojure.

alexmiller21:05:00

If you walk into a java lib, it will have a thing at the top of the file to download sources

alexmiller21:05:24

I do that all the time with java libs

alexmiller21:05:51

Although I guess that’s more IntelliJ than Cursive

Eddie22:05:24

I can download the sources jar for Scala and walk through the "Choose Sources..." prompt in IntelliJ and works fine. Maybe this is more of a deps.edn thing, but it would be neat if there was a way to declare the download of the sources in deps.edn and then Cursive could detect its existence and use it.

Eddie22:05:31

But that sounds like it might be a lot of work for something that would go relatively under utilized.

cfleming22:05:20

Yes, there’s no way to do this in deps itself, or in lein. Unfortunately the only way right now is to walk through the Choose Sources popup.

Eddie22:05:43

Alright, thanks!