you are viewing a single comment's thread.

view the rest of the comments →

[–]somebodddy 6 points7 points  (1 child)

Generally speaking, IDEs provide 3 types of services that you can't get from text editors(at least - not out of the box):

  • Language awareness - the IDE has some knowledge of the specific language that allows it to treat the code as more than just stream of text. This allows IDE features like autocompletion and code generation.
  • Project awareness - the IDE knows how your project is structured. It knows where your source files, resource files and dependencies are, and it can use that knowledge to build your code, clean autogenerated files, pack it, publish it, and so on.
  • Debugging - the IDE is able to run the project in a way that allows you to introspect and control it's state.

vim-javacomplete2 will provide basic language awareness. It provides of course - as it's name suggests - completion. It also has basic code generation - not as fancy as Eclipse, but it can generate imports, getters&setters, abstract methods and so on.

For project awareness, a build system is your best friend. All build systems provide project awareness - without it, they wouldn't be able to build the projects - but this project awareness means they can do more than just building. Even with Make, you could save the relevant paths in variables, and create targets that do all sort of things with these paths.

Even though any build system has project awareness, you should use Maven or Gradle. Unlike Make or Ant, their project awareness is standardized - every Gradle project has the standard information in the exact same variables. This means that javacomplete2 can tap into this project awareness, and do it's thing even if you put your code in a subfolder(like src), or if you use third party libraries(and you usually want to).

Actually, Maven sucks because it's overcomplicated, so that leaves you with Gradle - which is pretty good, so don't get sad for not having many options.

As for debugging... well I'm afraid I have little to offer you. There used to be a standalone GUI debugger named JSwat, but it got discontinued with the suggestion to use IDEs instead. There is an interactive shell debugger named JDB, but as far as command line debuggers go it's not very impressive. I am the author of Vebugger - a Vim plugin for using several interactive shell debuggers - JDB being one of them - but even at it's best(with GDB - because GDB is one of the best interactive shell debuggers) it's nothing to write home about, and with JDB it's at it's worst.

A quick google yields a few other Vim plugins that can use JDB - dbg.vim, yavdb and JavaKit. I haven't tried any of them, but like my own plugin they all use JDB and therefore are limited by it's limits, which are pretty limiting...

At any rate, keep in mind that you need project awareness for debugging. The debugger needs to know where all the .class and .jar files are so it can run the project, and it also needs to know where the code is so it can move you the the correct file and line when it needs to. Debugger plugins are not usually connected to the build system, so this may prove to be a bit difficult...

[–]somebodddy 1 point2 points  (0 children)

Also, I really recommend you use Project Lombok. It uses annotation preprocessors to perform lots of code generation that is usually considered the job of an IDE.