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

Go Toggle Declare

by waigani ST2/ST3

GoToggleDeclare is a Golang plugin for Sublime Text which toggles the short variable declaration := and the assignment operator =.

Labels go

Details

Installs

  • Total 462
  • Win 214
  • OS X 133
  • Linux 115
Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9
Windows 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
OS X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 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 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

GoToggleDeclare

GoToggleDeclare is a Golang plugin for Sublime Text which toggles the short variable declaration := and the assignment operator =.

Please checkout GoAutoDeclare for automatic correction on save.

Usage

Given the following line of code:

sum = func(a, b int) int { return a+b } (3, 4)

Place your cursor on the line and press shift+tab. You'll get:

sum := func(a, b int) int { return a+b } (3, 4)

GoToggleDeclare replaced = with :=, press shift+tab again and it will change it back.

Install

  1. Install Sublime Package Control (if you haven't done so already) from http://wbond.net/sublime_packages/package_control. Be sure to restart ST to complete the installation.

  2. Bring up the command palette (default ctrl+shift+p or cmd+shift+p) and start typing Package Control: Install Package then press return or click on that option to activate it. You will be presented with a new Quick Panel with the list of available packages. Type GoToggleDeclare and press return or on its entry to install GoToggleDeclare. If there is no entry for GoToggleDeclare, you most likely already have it installed.

Default key binding:

[
    { 
        "keys": ["shift+tab"], "command": "go_toggle_declare"
    }
]

You can set your own keybinding by copying the above into Preferences > Keybindings - User and replacing shift+tab with your preferred key(s).

License

GoAutoDeclare is released under the MIT license. See LICENSE.md