Created
July 15, 2012 21:53
-
-
Save alloy-d/3118845 to your computer and use it in GitHub Desktop.
Simple Sublime Text 2 plugin to enable quick toggling of the 'draw_white_space' setting between 'selection' and 'all'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{"caption": "Toggle Shown Spaces", "command": "toggle_shown_spaces"} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
class ToggleShownSpacesCommand(sublime_plugin.ApplicationCommand): | |
def run(self): | |
settings = sublime.load_settings("Preferences.sublime-settings") | |
draw_white_space = settings.get("draw_white_space") | |
if draw_white_space == "selection": | |
draw_white_space = "all" | |
else: | |
draw_white_space = "selection" | |
print "Attempting to set draw_white_space to", draw_white_space | |
settings.set("draw_white_space", draw_white_space) | |
sublime.save_settings("Preferences.sublime-settings") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment