使光标不在Sublime文本3中滚动过去的行

时间:2018-02-19 01:00:54

标签: sublimetext3

有没有办法确保在按住向右/向左箭头键时,光标永远不会越过当前行?就像Vim

1 个答案:

答案 0 :(得分:0)

只需将以下内容添加到您的用户键绑定中:

{ "keys": ["left"], "command": "noop", "context": [
        { "key": "preceding_text", "operator": "regex_match", "operand": "^$" }
    ],
},
{ "keys": ["right"], "command": "noop", "context": [
        { "key": "following_text", "operator": "regex_match", "operand": "^$" }
    ]
},

当插入符号位于行的开头时,这将覆盖左箭头键的默认行为;当插入符号位于行的末尾时,将覆盖右箭头键的默认行为,以调用noop命令,不执行任何操作,而不是通常的移动命令。