Sublime Text 2侧边栏上下文:类似Vim的键绑定用于侧边栏导航

7
有人知道Sublime Text 2侧边栏的“上下文”吗?或者有什么办法可以找到上下文吗?
我在Vintage模式下使用Sublime Text 2,并且配合几个自定义按键绑定(和VintageEx),很少离开主屏幕(home row)。重新绑定'j'、'k'等按键而不指定上下文,会导致在编辑窗口中进入插入模式时发生移动而不是输入j或k。更具体地说,有关此映射中应替换“???”的任何想法吗?
{ "keys": ["j"], "command": "move", "args": {"by": "lines", "forward": true} , "context": [{"key": "???"}] }

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

非常感谢!

1个回答

11

这是你需要的内容。只需将其添加到“首选项->键绑定-用户”中即可。

{ "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"} ]
}

希望这有所帮助!


谢谢,@deftOfCenter...很抱歉我这么晚才注意到有个答案! - jacob-ogre
我知道有点晚了,但很高兴能帮助@jacob-ogre。这也让我抓狂了。 - Dan Williams

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接