The automated import functionality is pretty straightforward. Simply place the cursor over the element to import and issue the command:
:JavaImport
and one of the following events will occur:
If you have numerous elements that you wish to import, you can also use:
:JavaImportMissing
which will look for all undefined types and attempt to find possible imports for them. If there is a single result then that result will be imported. In the event of multiple results for a given type, then you will be prompted to choose the result to import, just like when using :JavaImport.
In addition to importing elements, this plugin provides two additional commands:
Vim Variables
g:EclimJavaImportExclude - List of patterns to exclude from import results.
Ex.
let g:EclimJavaImportExclude = [ "^com\.sun\..*", "^sun\..*", "^sunw\..*" ]
g:EclimJavaImportPackageSeparationLevel (Default: -1) - Used to determine how imports are grouped together (or spaced apart). The number represents how many segments of the package name to use to determine equality, where equal imports are grouped together and separated from other groups with a blank line.
-1: Use the entire package name. Only imports from the same full package are grouped together.
0: Don’t look at any package segments. All imports are grouped together with no spacing.
n: Look at the first n segments of the package name.
Ex.
let g:EclimJavaImportPackageSeparationLevel = 2
Eclim Settings