Sublime Text 2 move cursor out of parenthesis, quotes, or brackets

后端 未结 12 782
囚心锁ツ
囚心锁ツ 2020-12-22 20:10

I need a fast way to make the cursor jump outside the auto wrap qoutes or other syntax elements. I don\'t want to have to reach down to my arrow keys each time, and definit

12条回答
  •  盖世英雄少女心
    2020-12-22 20:54

    I found another way which lies within sublime keybindings itself. Basically, I just modify the keybindings for auto closing parens, that is, I replace "contents": "($0)" with "contents": "($1)$0". Then just hit Tab to get out of the parenthesis. So I add in my keybindings the following:

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

    And similar for square brackets, curly brackets, and single and double quotes.

提交回复
热议问题