clean_imports : Makes use of the Java checkstyle tool to clean your Java file of unused imports
| script karma
Downloaded by 332
Comments, bugs, improvements
script versions (upload new version)
|This is a simple bash script that can be used as a filter in vim to clean your java of unused imports.
If you have the JavaImp plugin installed (vimscript #325) you can use it in conjunction with this to also sort your imports as well as clean them.
I have been using it in my own code and it works quite nicely. See http://paulbourke.blogspot.com/2012/04/clean-your-java-imports-in-vim.html for more info.
|Save the script somewhere in your path such as ~/bin and then add something like the following to your .vimrc
" F7 to call clean redundant Java imports and sort them
:command JavaImpClean exec JavaImpClean()
:nnoremap <F7> :JavaImpClean<CR>
Click on the package to download.
ip used for rating: 184.108.40.206