sublime-github icon indicating copy to clipboard operation
sublime-github copied to clipboard

ctrl-s to call update instead of save

Open sheldond opened this issue 12 years ago • 6 comments

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!

sheldond avatar Apr 10 '12 18:04 sheldond

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"}

bgreenlee avatar Apr 11 '12 04:04 bgreenlee

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.

sheldond avatar Apr 11 '12 14:04 sheldond

No, I don't think there's a way to do a custom context.

bgreenlee avatar Apr 11 '12 16:04 bgreenlee

Okay thanks anyways!

sheldond avatar Apr 11 '12 16:04 sheldond

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 avatar Aug 14 '12 13:08 OpaOnWindowsNow

@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.

bgreenlee avatar Aug 14 '12 15:08 bgreenlee