Skip autocompleted brackets, commas etc. with tab in sublime-text

前端 未结 2 963
终归单人心
终归单人心 2021-01-14 23:15

In sublime, if you type, alert(\"{ it will autocomplete the closing brackets and quotes to: alert(\"{}\").

In v

2条回答
  •  北海茫月
    2021-01-14 23:50

    Edit your .sublime-keymap file and add

    // Skip past round and square autocomplete brackets
        { 
            "keys": ["shift+enter"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
            [
                { "key": "following_text", "operator": "regex_contains", "operand": "^[)\"\\]\\}\\$]", "match_all": true },
                { "key": "auto_complete_visible", "operator": "equal", "operand": false }
            ]   
        },
    

    In this case, shift + enter will function like tab in visual studio.

    The solution is originally not mine - I found it either here or on the ST2 forum.

提交回复
热议问题