7

有谁知道 Sublime Text 2 侧边栏的“上下文”,或者知道如何找到上下文?

我在 Vintage 模式下使用 Sublime Text 2,以及几个自定义键绑定(和 VintageEx)很少需要离开主行。在不指定上下文的情况下重新绑定“j”、“k”等会在编辑窗口中转移到插入模式,以便移动而不是键入 j 或 k。更具体地说,关于什么应该替换“???”的任何想法 在这个映射中:

{ "keys": ["j"], "command": "move", "args": {"by": "lines", "forward": true} , "context": [{"key": "???"}] }

使用“j”代替侧边栏中的向下箭头?

非常感谢!

4

1 回答 1

10

干得好。只需将其添加到您的 Preferences->Key Bindings-User。

{ "keys": ["h"], "command": "move", "args": {"by": "characters", "forward": false}, "context":
    [ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["j"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
    [ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["k"], "command": "move", "args": {"by": "lines", "forward": false}, "context":
    [ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["l"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
    [ {"key": "control", "operand": "sidebar_tree"} ]
}

希望有帮助!

于 2013-07-10T14:17:59.480 回答