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
Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8
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