2016-10-23 40 views
3

在Sublime中,我可以轻松设置一个更复杂的热键,让我按Enter键退出引号和括号。它在这里如下:如何设置热键将光标移出引号/括号?

// Move out of single and double quotes with `Enter` 
    { 
     "keys": ["enter"], 
     "command": "move", 
     "args": {"by": "characters", "forward": true}, 
     "context": [ 
      { "key": "following_text", "operator": "regex_match", "operand": "(?:\"|').*", "match_all": true }, 

      { "key": "preceding_text", "operator": "regex_contains", "operand": "(?:\"|')", "match_all": true } 
     ] 
    }, 

在VS代码中,有没有什么办法可以实现这一点?这在keybindings.json移动光标,但它不活跃时,我也不想。谢谢。

{ "key": "enter", "command": "cursorRight", 
         "when": "editorTextFocus" } 

回答

1

看看这个扩展,你想要做什么 - https://marketplace.visualstudio.com/items?itemName=albert.TabOut

而且你可以在这里找到实现 - https://github.com/albertromkes/tabout

+0

嗨,罗布,我以前试过了扩展,但不在其语境意识方面工作得不错。它实际上有一个意想不到的副作用,就是作为一个制表符,而不仅仅是一个制表符,这使得不可能在以引号开头的行的开头添加新的制表符间距。 [问题5](https://github.com/albertromkes/tabout/issues/5) – cvax

相关问题