Sublime Forum

Double-click to select text between brackets

#1

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!

0 Likes

#2

Ctrl+Shift+Spacebar should expand sels to things.

More options can be found under the Selection item in the main menu.

0 Likes

#3

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.

0 Likes

#4

+1 for this!
Anyway since the functionality is already there, there is a simple way to bind it to dbl click?

0 Likes

#5

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

    {
        "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.

0 Likes

#6

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.

0 Likes

#7

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.

0 Likes