Sublime Forum

Multiple keyboard shortcuts

#1

Hello, is it possible to have multiple keyboard shortcuts for the same command? I’d like to mimic the Textmate shortcuts, specifically the Go To function shortcut (Shift-cmd-T) but I don’t want to overwrite the existing cmd-R shortcut, just add it. Looking at the sublime.keymap file I see the syntax is as follows:

{ "keys": "super+r", "super+shift+t"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },

But this doesn’t work, it only uses the last one.

What is the proper way to do it?

Thanks.

1 Like

#2

Along these lines, how do I recreate the Textmate shortcuts where Ctrl-Cmd-right (arrow) would move your current selection to the right. I’d like to actually move the selection by words (not characters as Textmate used to do).

Looking at the keyboard shortcuts file I see that the up and down arrows work, but with a value of 1.0 and -1.0 respectively, but how to get the selection to move left and right?

Thanks.

PS
Nobody has any idea about multiple keyboard shortcuts? It seems that now if I have more than one shortcut (see above post) neither will work. Anyone seeing this on OS X?
I’m using build 2125

0 Likes

#3

I’ve asked this same question before, and have been completely ignored.

Asked it via twitter as well.

I want to do it for searching. Mimic Emacs and Textmate’s search with ctrl+s. Incremental find doesn’t work the same way. Find would, if you could get it working off the same key.

My Thread: https://forum.sublimetext.com/t/assigning-to-commands-to-the-same-key-binding/2087/1

This is, i believe, the last hurdle for me switching to Sublime Text … but, i’m pretty sure this isn’t going to happen so I’m likely going to switch back to Emacs. I’ve been using emacs, or emacs like editors, for 16 years. That’s too much muscle memory for something that i use constantly, all day long, to have to relearn.

0 Likes

Assigning to commands to the same key binding
#4

[quote=“kakubei”]Hello, is it possible to have multiple keyboard shortcuts for the same command? I’d like to mimic the Textmate shortcuts, specifically the Go To function shortcut (Shift-cmd-T) but I don’t want to overwrite the existing cmd-R shortcut, just add it. Looking at the sublime.keymap file I see the syntax is as follows:

{ "keys": "super+r", "super+shift+t"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },

But this doesn’t work, it only uses the last one.

What is the proper way to do it?

Thanks.[/quote]

{ "keys": "super+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": "super+shift+t"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} }

didn’t work ?

"super+r", "super+shift+t"]

is a sequence.

1 Like

#5

@bizoo: ah so it’s a sequence! Wasn’t sure. What I ended up doing was copy/paste the same command into the users key bindings with different keys, that seemed to respect both the original and the new one.

Thanks for clarifying.

@mbond:

Yes, the find behavior is very strange to me. Even though I have wrap selected, it always fails to find anything when I’m near the end of the document, even obvious matches, don’t know what’s happening there. And I’d also like to see the ctrl-f behavior from Emacs. Let’s give it some time, still in beta and Jon makes changes almost daily. I believe this will be the best editor for Mac once it’s polished.

0 Likes