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
  • 34 minutes ago
  • 10 years ago

Installs

  • Total 679
  • Win 331
  • Mac 191
  • Linux 157
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 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21
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 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
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 1 0 0 0 0 0 0 0 0 0 0 0 0 1

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