【问题标题】:Get out of brackets and parenthesis with Tab用 Tab 跳出括号和括号
【发布时间】:2020-01-29 12:59:31
【问题描述】:

问题是你必须使用箭头或宏来跳出括号、方括号、花括号、单引号和双引号。

【问题讨论】:

  • 您可能希望从问题中取出答案并将它们分开
  • 我这样做了,但 Vijay 建议附加它们。我再把他们分开????

标签: sublimetext vscode-settings brackets


【解决方案1】:

我找到的简单解决方案

[VSCode]有一个名为TabOut的扩展,安装它(完成)。

[SublimeText3] 我们必须对 Key Bindings 进行一些更改 首选项>键绑定 将下面的 sn-p 复制并粘贴到右侧窗格中,保存并关闭此窗口。 (经过测试和工作✌)

[
    { "keys": ["("], "command": "insert_snippet", "args": {"contents": "($1)$0"}, "context":
    [
      { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
      { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
      { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
    ]
},


{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$1}$0"}, "context":
        [
            { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }
        ]
    },

{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[$1]$0"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
    ]
},

{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$1\"$0"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
        { "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
        { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
    ]
},

{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$1'$0"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
        { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true },
        { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true }
    ]
},
]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-05
    • 2023-03-18
    • 2021-01-11
    相关资源
    最近更新 更多