如果有人还在看这个......
在您的默认键绑定中,您会发现:
{ "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 将移动“子词”而不是“词”,这会考虑驼峰式。我更喜欢默认设置,所以我将 alt+direction 设置复制到我的用户键绑定中,并用 ctrl 替换了 alt 的实例。瞧,ctrl+direction 以驼峰命名方式以及定义的单词分隔符移动。
另外,我不确定使用 subwords 设置是否会考虑下划线,我总是在单词分隔符中添加 _ 以确保。