endo.anaconda
endo.anaconda

Reputation: 2468

VS Code: multi line keybindings

I use a shortcut with keybindings.json to put a single line into quotes, ending with a comma. text --> "text", this works well, but only for one line.

Now I have a long list of text and would like to put every line into quotes like this

text1 --> "text1",

text2 --> "text2",

text3 --> "text3",

text4 --> "text4",

Is there a way to do it? Help highly appreicated, because I would gain a lot of time, if i dont have to do it line by line.

Best endo

edit: here is the snippet from keybindings.json which puts every line in brackets

[
    {
        "key": "cmd+,",
        "command": "editor.action.insertSnippet",
        "when": "editorTextFocus",
        "args": {
            "snippet": "\"${TM_SELECTED_TEXT}\", "
        }
    }
]

Upvotes: 0

Views: 198

Answers (1)

Fjordo
Fjordo

Reputation: 872

try to use multi line selection with CTRL + ALT + Up/Down arrow and then, after you selected the rows, apply that shortcut of your

Upvotes: 1

Related Questions