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

Go Toggle Declare

by waigani ALL

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

Labels go

Details

  • 0.1.2
  • github.​com
  • github.​com
  • 10 years ago
  • 16 minutes ago
  • 10 years ago

Installs

  • Total 684
  • Win 333
  • Mac 193
  • Linux 158
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 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
Mac 0 1 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 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