崇高的文字word_separator
是:
"word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?",
我还想将CamelCase中的案例更改视为变更。有没有设置/方式来做到这一点?
(例如在FooBar中ctrl + bck_space应该只删除Bar)。
如果有人还在看这个......
在您的默认键绑定中,您将找到:
{ "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} },
{ "keys": ["ctrl+right"], "command": "move", "args": {"by": "word_ends", "forward": true} },
{ "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} },
{ "keys": ["ctrl+shift+right"], "command": "move", "args": {"by": "word_ends", "forward": true, "extend": true} },
{ "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
{ "keys": ["alt+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
{ "keys": ["alt+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
{ "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
使用alt + direction将移动“subwords”而不是“words”,这将考虑camelCase。我更喜欢超过默认值,所以我将alt +方向设置复制到我的用户键绑定中,并用ctrl替换alt的实例。 Voila,ctrl +方向由camelCase以及定义的单词分隔符移动。
此外,我不确定使用子词设置是否会考虑下划线,我总是将_添加到单词分隔符以确保。
我认为这只能通过插件来完成,而不仅仅是通过更改Sublime Text的设置。
使用alt只能用于移动,而不能用于删除,但我发现了一些非常有用的东西:
删除转发(alt +删除):
delete_subword.sublime-macro:
[
{
"command": "move",
"args": {
"by": "subwords",
"extend": true,
"forward": false
}
},
{
"args": null,
"command": "left_delete"
}
]
向后删除(alt +退格)
delete_subword_forward.sublime-macro:
[
{
"command": "move",
"args": {
"by": "subwords",
"extend": true,
"forward": true
}
},
{
"args": null,
"command": "right_delete"
}
]
将其保存到您的用户目录中。现在,你绑定这样的键:
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/User/delete_subword.sublime-macro"} },
{ "keys": ["alt+delete"], "command": "run_macro_file", "args": {"file": "Packages/User/delete_subword_forward.sublime-macro"} },
在vim模式下的Alt + W
在崇高的文本3中为我工作,以遍历camelCase单词
您可以尝试调整此移动,并查看此包中提供自定义移动代码的示例代码: https://github.com/robertcollier4/KeyboardNavigation https://packagecontrol.io/packages/KeyboardNavigation
KeyboardNavigation - 键盘移动以及选择和删除自定义分隔符。在连续的边界之间快速导航。对于SublimeText。