ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Groovy Imports

by carwinz ST2

A Sublime Text 2 plugin for inserting import statements into groovy code

Labels groovy, grails

Details

Installs

  • Total 559
  • Win 263
  • Mac 194
  • Linux 102
Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

A Sublime Text 2 plugin for inserting import statements into groovy code

No setup is required. The plugin finds possible imports:

  • By looking through other classes in the same project
  • By looking at imports in other classes in the same project
  • It is unaware of imports in libraries or the jdk, but you can make the plugin aware of common ones by adding a custom import (see: Tools > Groovy Imports > Edit custom imports)

Most people don't want their imports re-organized automatically, so the plugin attempts to insert new imports near similar ones. (But there is some scope for improvement here).

How to install

With Package Control:

  1. Run “Package Control: Install Package” command, find and install the “Groovy Imports” plugin.

Manually:

  1. Clone the git repo (https://github.com/carwinz/groovy-sublime-imports) into your packages folder (in ST, Preferences > Browse Packages… menu item to open this folder)

Usage

By default, imports will be automatically added when groovy files are saved, however you can turn this off in the config.

The default shortcut is Ctrl+Shift+Alt+i. Or use Go to Tools > Groovy Imports > Add imports

Future Development

  • The order that the imports are added needs some more tweaking
  • Support for wildcard imports (e.g. “some.package.*”)
  • If multiple options exist, pop up a dialog to select one
  • If a classname is used in a string, don't import it