Sublime Forum

How to efficiently move over autotyped characters?

#1

I’m loving Sublime Text 2 but I think I may be missing some opportunities to use it efficiently.

Say I’m typing something like foo’bar’].baz() and I have just typed the foo’

Sublime Text 2 will have automagically typed the '] for me and my cursor will be positioned between them. So now I type bar. To continue typing, I need to move past the autotyped '] characters. How do folks do that?

I can hit End if there is nothing else on the line but the End key is pretty far away.

I can hit forward arrow twice but if I’m going to type two characters I might as well have typed the '] myself.

Is there some magic for moving past the autotyped characters?

Thanks
gb

0 Likes

#2

Add this to “Preferences > Keybindings - User”:

[code] { “keys”: “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 }
]   

}[/code]

It should help. Now pressing enter will move you one character ahead if the next character is ) or ].

0 Likes