Auto import keyword(s), or remove unused imports of golang in sublime text. Also sorts imports when importing.
Finds imports from:
- Opened project path(if has
go.mod
) - Go library itself(GOROOT)
- Installed packages(GOMODCACHE)
Open command palette Package Control: Add Repository
:
https://github.com/amirHossein5/go-import
Then install it using package control by name of go-import
. Finally restart sublime text.
By default GOROOT and GOMODCACHE are /usr/lib/go
, ~/go/pkg/mod
.
To edit: GoImport: Settings
.
For modifing key bindings open command palette then GoImport: Edit key bindings
.
Available Default key bindings:
alt+i
-> command:go_import
alt+e
-> command:go_import_erase_unused
Available commands:
go_import
: Import libs under cursor(s).go_import_erase_unused
: Removes unused imports.
Licensed under the MIT license.