Sublime Forum

How to quickly select the contents of the brackets, external with double quotation marks or single quotation marks

#1

How to quickly select the contents of the brackets, external with double quotation marks or single quotation marks

0 Likes

#2

Can you elaborate more on what you want?

0 Likes

#3

Select the brackets in double quotation marks

0 Likes

#4

Okay, I’m still hazy on the exact behavior you are looking for, but I will give you two options. It sounds like you want to get content and brackets? If you are using BracketHighlighter, you can create the following key maps to help you select content of brackets and expand out consuming the bracket, and then the content of the parent brackets, etc. on each repeated press.

    // Select text between brackets
    {
        "keys": ["ctrl+alt+super+s"],
        "command": "bh_key",
        "args":
        {
            "no_outside_adj": null,
            "lines" : true,
            "plugin":
            {
                "type": ["__all__"],
                "command": "bh_modules.bracketselect"
            }
        }
    },

Or you can just select the content and brackets in one shot.

    // Select text including brackets
    {
        "keys": ["ctrl+alt+super+d"],
        "command": "bh_key",
        "args":
        {
            "lines" : true,
            "plugin":
            {
                "type": ["__all__"],
                "command": "bh_modules.bracketselect",
                "args": {"always_include_brackets": true}
            }
        }
    },

Hopefully that is what you are looking for. If not please describe in detail how you expect the desired feature to work. Only BracketHighlighter highlights brackets in strings, and only very generic square, curly, and round brackets.

1 Like

#5

0 Likes

#6

This is what I want, thank you very much for your reply

0 Likes

#7

There’s also:

https://packagecontrol.io/packages/Bracketeer

(command “bracketeer_select”)

and

https://packagecontrol.io/packages/Expand%20Selection%20to%20Quotes

(command “expand_selection_to_quotes”)

Calling the commands repeatedly will also expand to include brackets/quotes and then again and again.

0 Likes

#8

Do you mean like this?

If so i’m using Vintageous and you can use vi" or vi( in normal mode depending on what you want to select.

0 Likes

#9

@w3c0929, it looks like you are using BracketHighlighter. It has that command, and you can use the first keybinding I pointed out to do what you want (you can change the binding to what you like).

And if that doesn’t work for you, it looks like @devcarlos and @mg979 have alternative ways to do it. So it sounds like you have plenty of options.

0 Likes