2

Using Sublime Text 3, I love the feature that correspond to this :

// Controls auto pairing of quotes, brackets etc
    "auto_match_enabled": true

in Preferences.

The problem is, when I have something like this :

var_dump('Final link : '.$type);

and I want something like this :

var_dump('Final link : '.($type?$type:'false');

I have to close my right parenthesis BUT it just write OVER the existing one and I have to do it two times so my caret is AFTER the existing right parenthesis.

I want to keep the "auto pairing" feature but not this one and I can't find anything about it, is it possible ?

MattDMo
  • 100,794
  • 21
  • 241
  • 231
Seekme
  • 174
  • 8
  • `var_dump('Final link : '.($type?$type:'false');` is missing a final `)`. – MattDMo Mar 23 '15 at 19:08
  • Did you check this link: http://stackoverflow.com/questions/14032041/how-to-prevent-sublime-text-2-from-swallowing-closing-brackets-quotes-and-paren ? I know it's for version 2, but unless they changed how the settings worked, it should still apply. – Tim Lewis Mar 23 '15 at 19:15
  • @TimLewis Thank you, works perfectly ! It was the answer I needed. – Seekme Mar 23 '15 at 23:14

1 Answers1

0

I'm assuming you want your code to be

var_dump('Final link : '.($type?$type:'false'));

as you are missing a closing ) in your question. If this is the case, if you're starting from:

var_dump('Final link : '.$type);

place your cursor just after the ., then hit CtrlD to select $type:

$type selected

Next, just type an opening parenthesis (, and the selected text will be surrounded with opening and closing parentheses:

($type)

Finally, hit to place the cursor after the e in $type, and you can begin entering the rest of the expression.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • It should indeed works, but that's not really "my style" of writing (it might be a good habit to do this though : faster), [this post](http://stackoverflow.com/questions/14032041/how-to-prevent-sublime-text-2-from-swallowing-closing-brackets-quotes-and-paren) was a nice other way to do it. – Seekme Mar 23 '15 at 22:39