diff --git a/voussoir/Default (Windows).sublime-keymap b/voussoir/Default (Windows).sublime-keymap index a2a2771..bc65521 100644 --- a/voussoir/Default (Windows).sublime-keymap +++ b/voussoir/Default (Windows).sublime-keymap @@ -1,6 +1,7 @@ [ { "keys": ["ctrl+shift+c"], "command": "toggle_setting", "args": {"setting": "draw_centered"}}, { "keys": ["ctrl+shift+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}, +{ "keys": ["ctrl+shift+q"], "command": "toggle_draw_whitespace"}, { "keys": ["ctrl+shift+m"], "command": "toggle_minimap"}, { "keys": ["ctrl+shift+b"], "command": "expand_selection", "args": {"to": "brackets"} }, { "keys": ["ctrl+shift+n"], "command": "clone_file" }, diff --git a/voussoir/toggle_draw_whitespace.py b/voussoir/toggle_draw_whitespace.py new file mode 100644 index 0000000..8f251a1 --- /dev/null +++ b/voussoir/toggle_draw_whitespace.py @@ -0,0 +1,17 @@ +''' +Thank you facelessuser +https://forum.sublimetext.com/t/keybinding-draw-white-space-toggle/5122 +''' +import sublime +import sublime_plugin + +class ToggleDrawWhitespaceCommand(sublime_plugin.TextCommand): + def run(self, edit, options=["selection", "all"]): + try: + current = self.view.settings().get("draw_white_space", "selection") + index = options.index(current) + except: + index = 0 + + index = (index + 1) % len(options) + self.view.settings().set("draw_white_space", options[index])