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

Cycle Setting

by jmm ST2

Adds a `cycle_setting` command to Sublime Text 2, complementing the built-in `set_setting` and `toggle_setting`.

Details

  • 2012.02.23.14.13.42
  • github.​com
  • github.​com
  • 12 years ago
  • 2 hours ago
  • 12 years ago

Installs

  • Total 154
  • Win 83
  • Mac 46
  • Linux 25
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 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10
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

Cycle Setting plugin for Sublime Text 2.
Copyright 2012 Jesse McCarthy <http://jessemccarthy.net/>.

Adds a command that can be called from a key binding to toggle or
cycle through values for a non-boolean setting.

The Software may be used under the MIT (aka X11) license or Simplified
BSD (aka FreeBSD) license. See LICENSE

There are 'set_setting' and 'toggle_setting' commands built in to
Sublime Text 2 that can be called from key bindings. But, as far as I
can tell, 'toggle_setting' only works for boolean settings, such as
'word_wrap'.

This plugin adds a 'cycle_setting' command that can cycle through
several values for a setting, or toggle between two for a non-boolean
setting. An example setting is 'draw_white_space'. 'cycle_setting'
can be used to cycle through the values 'none', 'selection', and
'all', or toggle between two, such as 'none' and 'all'.

Currently this changes the setting for the current buffer, like the
built in 'set_setting' and 'toggle_setting'.


USAGE:

See the sample sublime-keymap file for an example.

Set 'command' to 'cycle_setting'.

Set 'args.setting' to the desired setting.

Set 'args.options' to a list of the setting values you want to cycle
through.


TO DO:

* Figure out a way to skip this code if a built in command of the same
* name, and especially with the same features, is introduced.

* Figure out if some settings have enumerated values that I can read
* in the plugin, in case the user would just like to cycle through all
* available options.