I’m writing some Java code in vim and really miss the feature afforded by the IDEs such that I can type up a block of code, and after a few keystrokes have the IDE infer which imports it should place at the top of my file based on the classes I’ve used in my code.
Anyone know of a way to achieve this functionality in vim? I’m thinking a command-line tool I can shell to for the file being edited. The tool would ideally dump the imports to the screen after it’s analysed my Java file.
You can try these links
http://vim.wikia.com/wiki/Add_Java_import_statements_automatically
Vim & Java: add java import statements automatically
Haven’t tried it myself but its a good start.