Java – Tips for using Vim as a Java IDE?

idejavavim

I'm addicted to Vim, it's now my de facto way of editing text files.

Being that it's mainly a text editor and not an IDE, has anyone got tricks for me to make it easier when developing Java apps?

Some questions I have:

  • How do I invoke a maven task without leaving vi?
  • Can I get code completion?
  • How's the syntax highlighting?

Anything else (other than "Don't do it!") that I should know about?

Best Answer

Some tips:

  • Make sure you use vim (vi improved). Linux and some versions of UNIX symlink vi to vim.
  • You can get code completion with eclim
  • Or you can get vi functionality within Eclipse with viPlugin
  • Syntax highlighting is great with vim
  • Vim has good support for writing little macros like running ant/maven builds

Have fun :-)