sublime-github
sublime-github copied to clipboard
ctrl-s to call update instead of save
It would be very handy to have the option of specifying in my user key config that when editing a gist and ctrl-s is pressed the update command is called instead of normal save. At this point the file should be marked in ST2 as saved so that upon closing the user isn't prompted to save the gist as a file.
Or more simply: make updating and closing a gist faster :)
Thanks for the plugin!
I looked into this and it doesn't look like it is possible to override save. I can hook into a pre-save or post-save event and update the gist, but you'd still have to save it locally, which is not what you want.
What about just setting a custom key binding for updating the gist? For example, to map shift-alt-U (or shift-cmd-U) to update, just stick this in your Key Bindings - User:
{ "keys": ["super+shift+u"], "command": "update_gist"}
Thanks for the reply! I've noticed some key bindings have a "context", could it be possible to re-bind ctrl-s to the update_gist when the current file context is a gist? Regardless, setting a hotkey is definitely helpful and speeds things up.
No, I don't think there's a way to do a custom context.
Okay thanks anyways!
We can have a context on a particular kind of file, for instance for Opa language, the following is working :
{ "keys": ["ctrl+s"], "command": "run_opa_build", "context": [{ "key": "selector", "operator": "equal", "operand": source.opa" } ] }
@OpaOnWindowsNow That's good to know, thanks. That won't help with this issue, though, as gists can be any file type. But I'll reopen the issue anyway so I remember to take a look at it again sometime.