Sublime Forum

Double-click to select text between brackets


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!



Ctrl+Shift+Spacebar should expand sels to things.

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



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.



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



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.



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.



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.