Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some good plugins for developing Java in VIM?

Tags:

java

vim

I love vim, but not having things like IntelliSense/Code completion from Eclipse makes it pretty difficult. I know, I know, I should be able to look at method signatures and java docs for the API I am interested in using. I'd love to, but I'd like it to be accessible from my fingertips instead of having to browse the source tree manually or have a JDK reference handy.

What plugins would make this easier?

like image 468
Nick Stinemates Avatar asked Oct 31 '09 22:10

Nick Stinemates


People also ask

What are plugins in Vim?

vim is a plugin that wraps the command-line fuzzy finder program fzf, allowing you to use it directly within Vim. Fzf is a fast and portable fuzzy finder application written in Go. It is a requirement for the Vim plugin, so make sure you install it first.

Can we code Java in Vim?

There's a great vim plugin JavaRun that covers the basics of compiling and running, as well as having abbreviations for common code bits that save typing. Just drop it into %HOME%\vimfiles\plugin on Windows.

Is Vim good for Java development?

Unfortunately, for most of that long time, Vim was not a viable option for Java (or Scala) development. But something has changed in the last year or two: the Language Server Protocol (LSP) has become really good. Honestly though, for most people, I still wouldn't recommend using Vim for Java development.


2 Answers

I tried eclim for a while. It was pretty good, basically it uses eclipse in the background as a kind of engine and provides a plugin to let you use all of eclipses goodness through vim.

http://eclim.org/

like image 80
Benj Avatar answered Oct 12 '22 01:10

Benj


Don't write Java in Vim — put Vim inside a Java IDE:

  • IdeaVIM for IntelliJ
  • viPlugin or Eclim for Eclipse
  • jVi or ViEx for NetBeans

I love Vim, but using an IDE for Java is the only way to stay sane. A decent Java IDE will:

  • Show invalid syntax or type errors
  • Show missing JavaDoc
  • Manage import statements for you
  • Highlight unused methods and variables
  • Safely perform powerful refactorings such as moving methods or renaming classes -- (no, search and replace doesn't cut it, I promise)
  • Reformat your code automatically or on-demand

Vim can't do the above, but you can use all the Vim keybindings in a program which does.

like image 25
a paid nerd Avatar answered Oct 12 '22 00:10

a paid nerd