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