简体   繁体   English

OSX上的Sublime Text 3-右键删除

[英]Sublime Text 3 on OSX - right delete

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. 我想将ST3(在OSX上)设置为类似于BBEdit的右删除,其中[shift + delete]删除光标右侧的单个字符。 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 编辑:更改空间+删除以移动+删除

The delete key does this by default on Windows/Linux via this keybinding: 在Windows / Linux上,默认情况下, delete键通过以下键绑定来执行此操作:

{ "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. 由于某种原因,在OSX下默认情况下似乎没有任何键绑定到此命令,这可能是由于Apple提出的某些用户界面最佳做法或类似的做法。

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). 这里要注意的一点是,即使该键在MacOS键盘上标有“ delete ”,它也位于Backspace键在非Mac键盘上的位置,这就是Sublime在内部将其映射到该键的位置(尽管出于一致性考虑,不确定)。

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: 通过使用“ View > Show ConsoleCtrl +`的关联键绑定打开Sublime控制台,您可以输入以下两个命令之一或全部:

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. 其中的第一个将导致Sublime将所有输入回显到控制台,从而使您能够查看其对输入的解释,在这种情况下或使用非美国布局的键盘时,这会派上用场。

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. 第二个将导致Sublime在执行时回显所有命令,这对于确定特定的按键绑定,菜单项或命令面板项正在执行的操作很有帮助。

Both commands remain in effect until you run them again with a False parameter to turn them off or restart Sublime. 这两个命令一直有效,直到您使用False参数再次运行它们以关闭它们或重新启动Sublime为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM