1

In Sublime Text 2 (or 3), is there a keyboard shortcut of some sort (tab? enter?) to go from the cursor denoted by |:

$var->catch('someName|');

to

$var->catch('someName');|

or

$var->catch('someName');
|
ina
  • 19,167
  • 39
  • 122
  • 201

1 Answers1

1

For your first scenario, you can modify this answer slightly: https://stackoverflow.com/a/19957050/1569064 (note the addition of the single quote, ', and the semi-colon ;, in the operand values

// Move to end of line
   { 
    "keys": ["shift+enter"], "command": "move_to", "args": {"to": "eol", "extend": false}, "context":
    [
        { "key": "following_text", "operator": "regex_contains", "operand": "^[)\"';\\]\\}\\$]", "match_all": true },
        { "key": "auto_complete_visible", "operator": "equal", "operand": false }
    ]   
},
// Move to next line
{ 
    "keys": ["ctrl+shift+enter"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true}, "context":
    [
        { "key": "following_text", "operator": "regex_contains", "operand": "^[)\"';\\]\\}\\$]", "match_all": true },
        { "key": "auto_complete_visible", "operator": "equal", "operand": false }
    ]   
}

My answer for your second example works when there is an empty line below. Otherwise, it moves the cursor to the end of that next, non-empty line.

Community
  • 1
  • 1
AGS
  • 14,288
  • 5
  • 52
  • 67