1

What do I want

It is just for comfort but I am searching for a feature in VSCode to insert a semicolon at the end of the current line, while the cursor is still in the middle of the statement. IntelliJ has that Feature. (crtl + shift + enter)

What I have tried so far:

  • Installed and enabled IntelliJ IDEA Keybindings.
    • The problem I have is that crtl + shift + enter does only complete the statment if autocomplete has an suggestion. But there is no suggestion add semicolon at the end of the line.
    • shift+ crtl + enter does start a new line but there is still no semicolon at the end

If I you need more information please let me know...

4
  • with the extension Multi Command you can group commands and set a keybinding to this new command, to type ; use the command: type Commented Nov 7, 2020 at 20:15
  • Isn't stackoverflow.com/questions/50703124/… an exact duplicate? It had a poor title so it is difficult to discover, I will edit it soon. Commented Nov 8, 2020 at 4:22
  • @Mark yes it is related. But I didn't find it because it was for webstorm and I searched for Java with IntelliJ. Thats why I was not abel to find it. Commented Nov 9, 2020 at 8:20
  • No worries, it was written oddly so probably only I could have found it. I have edited it some. Commented Nov 9, 2020 at 16:02

1 Answer 1

1

Thanks to rioV8 for the help with Multi Command.

I added the following snippet to the settings.json:

"multiCommand.commands": [ { "command": "multiCommand.addNewLine", "sequence": [ "cursorEnd", {"command": "type", "args": {"text": ";\n"}} ] } ] 

Than I was able to bind a keybinding to that command in the keybindings.json.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.