Ⅰ. 插件描述
Vim java imports managerⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'jvenant/vim-java-imports'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'jvenant/vim-java-imports'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'jvenant/vim-java-imports'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/jvenant/vim-java-imports
Ⅳ. 文档说明
Vim java imports manager
Licence:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License.
See http://www.gnu.org/copyleft/gpl.txt
Summary Of Features:
- Insert import
- Sort imports
- Insert package declaration
Usage:
Copy this file in your vim plugin folder
No classpath or configuration needed. This plugin use the regular vim search.
So you only need a good search index (through ctags or cscope for example)
Commands
- <Leader>is Sort imports
- <Leader>ia Search class from <cword>, add it to the imports and sort imports
- <Leader>ip add or replace package declaration
- You can define the package sort order using g:sortedPackage
- You can define the package deth blank line separator using g:packageSepDepth
Notes:
This plugin is an improvement of the anonymous function found here :
http://vim.wikia.com/wiki/Add_Java_import_statements_automatically