tvn
tvn

Reputation: 65

VS code+JavaScript shortcut for end line with a semicolon and go to the next line

Here is example of what I want to do:

From this to this

I used Ctrl+Shift+T in WebStorm but now I'm stuck with finding the equal shortcut at VsCode. Any suggestions?

Upvotes: 3

Views: 2724

Answers (3)

X.Angry.X
X.Angry.X

Reputation: 79

I had the same issue and I solved with the shortcut Ctrl+Enter

Upvotes: 7

japc
japc

Reputation: 11

You can install the Auto Insert Semicolon extension.

Work fine for me.Shortcut: alt+enter

Upvotes: 0

Mark
Mark

Reputation: 181218

I think you will need to set up a macro for that, it isn't built-in. See vscode macro extension.

And this in your settings:

"macros": {

    "insert semicolon and goto next line": [

        "cursorLineEnd",
        {
          "command": "type",
          "args": {
            "text": ";"
          }
        },
        "editor.action.insertLineAfter"
    ]
}

Set up a keybinding for that:

{
  "key": "ctrl+shift+;",
  "command": "macros.insert semicolon and goto next line"
},

Upvotes: 5

Related Questions