Home Download Buy Blog Forum Support

Double-click to select text between brackets

Double-click to select text between brackets

Postby loftrumbler on Tue Mar 19, 2013 3:20 pm

Hi there,

I'm making the transition to Sublime Text 2 from BBEdit as my new company uses Windows machines. So far i'm very happy with Sublime Text 2 but one of the features I am missing the most is selecting of text between brackets by double-clicking between those brackets. Is this a feature I have somehow not found? Does this feature actually exist either in the core product or via a plugin?

Many thanks!
loftrumbler
 
Posts: 1
Joined: Tue Mar 19, 2013 3:13 pm

Re: Double-click to select text between brackets

Postby guillermooo on Tue Mar 19, 2013 4:01 pm

Ctrl+Shift+Spacebar should expand sels to *things*.

More options can be found under the Selection item in the main menu.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Double-click to select text between brackets

Postby CrazyChoco on Mon Apr 08, 2013 2:07 pm

Hi there

Sorry to bump this, but I'm in pretty much the same situation,

I do know that I can place my cursor either inside or next to some brackets and then press Ctrl-Shift-M either once or twice to do the same thing, but being able to just double-click in the right place is a lot faster and I really miss that feature.
CrazyChoco
 
Posts: 7
Joined: Mon Apr 08, 2013 1:43 pm

Re: Double-click to select text between brackets

Postby davidfregoli on Fri Apr 19, 2013 10:51 am

+1 for this!
Anyway since the functionality is already there, there is a simple way to bind it to dbl click?
davidfregoli
 
Posts: 6
Joined: Tue Apr 16, 2013 11:52 am

Re: Double-click to select text between brackets

Postby skuroda on Fri Apr 19, 2013 8:03 pm

You can create a Default (<platform>).sublime-mousemap and add the following:

Code: Select all
[
    {
        "button": "button1", "count": 2,
        "command": "expand_selection",
        "args": {"to": "scope"}
    }
]


Note that there is only 1 mouse map. There are no context as with keymaps. So this will override the build in behavior globally.
skuroda
 
Posts: 685
Joined: Fri Oct 05, 2012 8:11 am

Re: Double-click to select text between brackets

Postby CrazyChoco on Fri May 03, 2013 2:19 pm

Hey, not bad.

But to mirror BBEdit's functionality you'd need to make it so that the intelligent selection logic only triggered if you double clicked on any bracket or quote symbol. If you double-click on a word or whitespace, then that word or whitespace should be selected as normal.
CrazyChoco
 
Posts: 7
Joined: Mon Apr 08, 2013 1:43 pm

Re: Double-click to select text between brackets

Postby skuroda on Sat May 04, 2013 6:54 am

You could probably write a custom command that looks at the text surrounding the cursor, then does the appropriate action if you want the exact behavior.
skuroda
 
Posts: 685
Joined: Fri Oct 05, 2012 8:11 am


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 6 guests