Sublimetext2 改变";}的行为&引用;升华文本3复古模式下的快捷方式
在升华文本3复古模式下,键盘快捷键“}”执行以下命令:Sublimetext2 改变";}的行为&引用;升华文本3复古模式下的快捷方式,sublimetext2,sublimetext,sublimetext3,Sublimetext2,Sublimetext,Sublimetext3,在升华文本3复古模式下,键盘快捷键“}”执行以下命令: { "keys": ["}"], "command": "set_motion", "args": { "motion": "move", "motion_args": { "by": "stops", "empty_line": true, "extend": true, "forward": true, "separators": "",
{
"keys": ["}"],
"command": "set_motion",
"args": {
"motion": "move",
"motion_args": {
"by": "stops",
"empty_line": true,
"extend": true,
"forward": true,
"separators": "",
"word_begin": false
}
}
}
我找不到关于set_motion的好文档,也不知道从哪里开始从头开始实现
如何更改行为,使其不移动到下一个空行,而只移动到下一个只有空格的行?
谢谢 对set_motion命令没有什么帮助,但是自己通过插件来完成也不坏。首先,这里是ST3API文档的一个示例。您将创建一个
升华插件.TextCommand
。特别令人感兴趣的是视图#sel
,视图#行
,以及视图#substr
view#sel
将获取光标的位置
view#line
通过一个传入点(最初从view#sel
检索)将创建一个整条线的区域
view#substr
获取区域(来自view#line
的结果)并返回该行中的字符串。可以使用正则表达式查看该行是否只包含空格,并适当放置光标。如果线不符合要求,可以增加区域中的第二个点以移动到下一条线
希望这能帮助你朝着正确的方向前进 以下是软件作者对“by”选项可用性的评论:“stops”
谢谢你的领先!如果我得到一个有效的解决方案,我会尝试并发布。
If you need more control, then using the move command with “by”: “stops” should allow more configurability. When using stops, you need to tell the command which logical units to stop on. The options are:
"word_begin": false,
"word_end": false,
"punct_begin": false,
"punct_end": false,
"sub_word_begin": false,
"sub_word_end": false,
"line_begin": false,
"line_end": false,
"empty_line": false,