sublimetext3 - How to set key-bindings in Sublime that change values of settings? -
i'm looking bind "alt+f11" binding toggle "draw_centered", centers text in distraction-free mode. i'm not sure how work though.
heres keybinds far:
//if draw_centered == true, set false { "keys": ["alt+f11"], "command": "set_setting", "args": { "setting": "draw_centered", "value": "true", }, "context": [ { "key": "setting.draw_centered", "operator": "equal", "operand": false} ] }, //if draw_centered == false, set true { "keys": ["alt+f11"], "command": "set_setting", "args": { "setting": "draw_centered", "value": "false", }, "context": [ { "key": "setting.draw_centered", "operator": "equal", "operand": true} ] }
i couldn't find command automatically toggled "draw_centered", had resort building sort of advanced command. i'm having bit of trouble understanding documentation on keybindings, tried follow "contexts" example. point i'm doing wrong?
thanks sergiofc tip toggle_setting! got work code:
{ "keys": ["alt+f11"], "command": "toggle_setting", "args": { "setting": "draw_centered", } }
edit: discovered bug this. after using key-combination "alt-f11" now, distraction-free mode isn't behaving should. follows draw_centered state in when switch normal distraction-free mode.
for example: if have file opened , click 'alt-f11' left-aligned (i.e. draw_centered = false) , window remain left-aligned when enter distraction-free mode. ideas why , how fix it?
Comments
Post a Comment