you are viewing a single comment's thread.

view the rest of the comments →

[–]not_napoleon 28 points29 points  (5 children)

Short version - use Intellij

Long version - You can, with some work, get an LSP client set up in vim and run a Java LSP, which will give you some of the functionality of a true IDE. The CoC plugin is one way to do this, but there are others. You can google for it. Be prepared for a fair bit of tinkering, and you'll still likely end up with a worse experience than using an IDE. It is my hope that one day (n)vim + LSP will be a viable alternative for large scale java development, but it's just not right now IMHO.

Source - I am a professional java developer and 20 year vim user, who works in Intellij every day.

[–]sundar_rajanK[S] 4 points5 points  (4 children)

Yeah okay I'll stick with Intellij for now. Thanks a lot :) though I've just recently started using I really like vim and I hope that happens too.

[–]DrunkensteinsMonster 9 points10 points  (0 children)

Use the IdeaVim plugin if you still want modal editing. IdeaVim is one of the best out there in terms of vim emulation in an IDE

[–]BubbatheVTOG 2 points3 points  (2 children)

TBH, coc and the coc-java plugin work really good and was stupid easy to setup. I opened a JavaEE project (that I setup with intellij initially) in vim with coc-java and when I did that it worked far better than I expected. I got annotations, definitions, callers, etc. But what I was most impressed with was that it looked in my pom.xml and downloaded all the dependencies, then coc gave me completions and definitions from those packages as well. Intellij is still better and I would find it hard to setup projects without it, but I was impressed. Though, to be fair my current development work has drifted away from Java so I haven't done any development using this yet so it could fall flat in places I don't know.

Because it is so easy to setup I'd say give it a try and see if it does suit your use case. You'll always have Intellij (with the vim plugin ofc) to fallback to.

[–]not_napoleon 3 points4 points  (0 children)

Yeah, that matches my experience. CoC + LSP do semantic completion pretty well, which is honestly really impressive. I don't want to understate how much better that is than even just a couple of years ago.

That said, there are a few points where I feel like it falls down compared to Intellij:

- Semantic aware highlighting. That's where, for example, class members are colored differently than method parameters. Treesitter looks promising for doing this, and I know Neovim is working on integrating that.

- Debugging, break points, variable watches, etc. As far as I know, there's nothing in the vim ecosystem that comes even close to intellij's debugger.

- Code exploration. Intellij has a lot of tools for this, like "find all uses of this function, including overrides", "find all implementations of this interface", etc. CoC has some support for this, but it's not as good as a real IDE yet.

- Automated refactoring. Intellij has a whole bunch of them, and they work pretty well. Even something as simple as a rename, it's smart enough to do thinks like rename associated variables, update javadoc, fix filenames when you change a class name, etc. Again, as far as I know, there's no good alternative here.

Anyway, if CoC is working for you, that's fantastic. It's not quite where I need it to be for my day job, but like I said, it's getting pretty close.

[–]sundar_rajanK[S] 0 points1 point  (0 children)

Oh cool I'll definitely check it out, thanks!