Reputation: 195
I would like to set ST3 (on OSX) to do a right delete similar to BBEdit where [shift+delete] deletes a single character to the right of the cursor. Googling is only turning up how to right delete a word at a time, but not a space. How can I set this up in the keymap?
EDIT: Changed space+delete to shift+delete
Upvotes: 1
Views: 719
Reputation: 22791
The delete
key does this by default on Windows/Linux via this keybinding:
{ "keys": ["delete"], "command": "right_delete" },
There doesn't seem to be any key bound to this command by default under OSX for some reason, possibly due to some user interface best practices set out by Apple or some such.
A key binding such as the following will do what you want:
{ "keys": ["shift+backspace"], "command": "right_delete" },
Something to note here is that even though the key is labeled delete
on the MacOS keyboard, it's in the position that the Backspace
key is on non-Mac keyboards, and this is what Sublime maps that key to internally (possibly for consistency although I am uncertain).
By opening the Sublime console with View > Show Console
or the associated key binding of Ctrl+`, you can enter one or both of the following commands:
sublime.log_input(True)
sublime.log_commands(True)
The first of these will cause Sublime to echo all input into the console, allowing you to see how it's interpreting your input, which can come in handy in cases like this or cases where you are using a keyboard with a non-US layout.
The second will cause Sublime to echo all commands that are executed as they happen, which is helpful for determining what a particular key binding, menu item or command palette item is doing.
Both commands remain in effect until you run them again with a False
parameter to turn them off or restart Sublime.
Upvotes: 4