Home Download Buy Blog Forum Support

How to efficiently move over autotyped characters?

How to efficiently move over autotyped characters?

Postby GaryBishop on Mon Jan 09, 2012 12:37 am

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
GaryBishop
 
Posts: 3
Joined: Mon Jan 09, 2012 12:32 am

Re: How to efficiently move over autotyped characters?

Postby C0D312 on Mon Jan 09, 2012 1:26 am

Add this to "Preferences > Keybindings - User":

Code: Select all
{ "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 }
    ]   
  }


It should help. Now pressing enter will move you one character ahead if the next character is ) or ].
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 34 guests