Sublime Forum

How to modify tab key to move after ")" or "}"?

#1

My English is poor, sorry!
I want to do this : when press tab key , if the cursor is before “)” or “}”, then place the cursor after “)” or “}”.

any one know how to do it ? thank you very much.

PS : I find someone define keys like bellow:
I think this can help to achieve what I want,any thread tell about detail parameters of key binding ?

{
        "keys": ["tab"], 
        "command": "expand_abbreviation_by_tab",

        // Extend Emmet to js & jsx
        "context": [
            {
                "operand": "source.js",
                "operator": "equal", 
                "match_all": true, 
                "key": "selector"
            },

            // run only if there's no selected text
            {
                "match_all": true, 
                "key": "selection_empty"
            },

            // don't work if completion popup is visible and you
            // want to insert completion with Tab. If you want to
            // expand Emmet with Tab even if popup is visible -- 
            // remove this section
            {
                "operand": false, 
                "operator": "equal", 
                "match_all": true, 
                "key": "auto_complete_visible"
            }
        ]
    },
0 Likes

#2

Add this keybinding:

    {
        "keys": ["tab"], "command": "move", "args": { "forward": true, "by": "characters" },
        "context":
        [
            { "key": "following_text", "operator": "regex_contains", "operand": "^(\\}|\\]|\\))", "match_all": true },
            // avoid unexpected interference
            { "key": "has_next_field", "operator": "equal", "operand": false },
            { "key": "auto_complete_visible", "operator": "equal", "operand": false },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        ]
    },
4 Likes

#3

well done! it works

0 Likes