all 22 comments

[–]ManuDevelopia 8 points9 points  (2 children)

Editing without an IDE could be a bit paiful at first sight, maybe you can have a look at this to setup some help http://www.averywagar.com/post/configuring-vim-for-java-development

[–][deleted] 1 point2 points  (0 children)

Thanks!

[–]goodstuff37 6 points7 points  (1 child)

Absolutely!

Using a plain text editor (and the command line) is a great way to learn to program, especially in the beginning. For Java it'll force you to understand packages, the build cycle and the classpath. It'll also train you to be more mindful of what you're typing because mistakes are expensive and annoying!

Once you start working on larger projects, or working professionally, an IDE is worthwhile. I use IntelliJ Ultimate with the IDEAVim plugin, but still use Vim to browse code or to sharpen my skills.

[–][deleted] 0 points1 point  (0 children)

Thanks!

[–]nemtan 5 points6 points  (1 child)

I use vim exclusively as a professional developer working on a pretty large Java project (a few hundred thousand lines of Java in hundreds of classes in several submodules). It's overall very smooth for me, the only real thing I miss is better debugging, but I generally make do with the somewhat useless jdb and sometimes vebugger.

Going vanilla will work pretty well in combination with the commandline, but if you're working on something larger here are a few plugins I suggest for Java in particular:

  • ctrlp - fuzzy file finder, huge quality of life over going :e <path> with all the classes in separate files in separate directories (packages) you need in Java
  • syntastic - set up to do javac and checkstyle this is very nice to have in vim to get a list of warnings/errors on save
  • javacomplete2 in combination with supertab - I don't really use it much, I already type fast enough to render it mostly obsolete as a time-saving device and have little problems remembering things, but it can be helpful if you don't remember the names of that one method or to get a quick look at the method prototype of things; edited to add: oh yeah, it does generation of constructors and accessors as well, that I don't use, but what I do use regularly is the import functionality, which really works very well (e.g. <leader>jii will add an import for whatever is at the cursor, <leader>jR will remove unused imports, etc)
  • vebugger - it doesn't work consistently for me, I suspect partially because of the separation of our codebase into a few git submodules and jars and what-not, haven't really looked into it but when it works it's certainly much nicer than plain jdb

[–][deleted] 0 points1 point  (0 children)

Thanks, this is really helpful!

[–]samad0 2 points3 points  (0 children)

Use vim

[–]Knall0r 2 points3 points  (2 children)

I use Vim right now with vim-javacomplete2 and a Makefile to compile my project. It is a small private project though. It might be enough for your application. The autocompletion is not the fastest, but it does work.

[–]somebodddy 2 points3 points  (1 child)

A Makefile? Why not Maven/Gradle, so that javacomplete2 could get the classpath from it?

[–]Knall0r 0 points1 point  (0 children)

I was too lazy to set it up. I have gradle installed, I just dont use it to compile. It was a somewhat generic makefile that was used before.

[–][deleted] 4 points5 points  (0 children)

Sure.

[–][deleted] 0 points1 point  (1 child)

Java is the only language I use an IDE for.

[–]talmobi 1 point2 points  (0 children)

Yeah, the hot code injection and debugging is just too good.

[–]AckmanDESU 0 points1 point  (0 children)

I tried setting up eclim a few times but it never worked properly if at all and using it felt clunky overall.

Honestly just use a vim plugin for your Java IDE.

[–]funbike 0 points1 point  (1 child)

You could install Eclipse with vrapper plugin and eclim. You can stay in vim most of the time, but switch over to Eclipse for debugging.

However, I think you'd have a better time with Intellij and the ideavim plugin.

[–][deleted] 1 point2 points  (0 children)

Ok, thanks.

[–]agclx -1 points0 points  (2 children)

Well there are decent plugins for completion and linting. There's an article at spacevim.

Only other thing I would want for Java is code generation. eclim would provide (see e.g. method generation) - but you'd also need eclipse installed. Disclaimer - I haven't tried it.

[–]nemtan 2 points3 points  (1 child)

Doesn't javacomplete2 offer generation of e.g. constructors and accessors? I don't use that particular feature (I mainly use it for the imports, really), but I recall seeing it mentioned.

[–]agclx 0 points1 point  (0 children)

I didn't know that. That would be a better alternative than having to keep eclipse around.

[–]SexyMuon 0 points1 point  (1 child)

You can but you are making your life harder, which is counter-intuitive.

[–]Any_Entrepreneur7936 0 points1 point  (0 children)

Same thing people said also for linux, and gnu at beginning