I keep pressing shift + enter in VSCode by accident and it brings up the terminal, is there a way to disable this shortcut?
3 Answers
Open the shortcuts settings on vscode (either from "settings", or with "Ctrl + K, Ctrl + S") and search which shortcut you have assigned to "Shift Enter".
You can enter "Shift Enter" directly in the search box to see those.
Then edit or delete those you don't want
2 Comments
If you prefer to set this in your user keybindings.json file, you can add these lines:
{ "key": "shift+enter", "command": "-python.execSelectionInTerminal", "when": "editorTextFocus && !findInputFocussed && !isCompositeNotebook && !jupyter.ownsSelection && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python'" }, Footnote:
The way I constructed this was to find the offending keybinding using this answer, change the keybinding to some other key, look at what was produced in my keybindings.json file, and then remove the "some other key" binding, leaving only the subtractive (-) version of the command.
Comments
On Visual Studio 2019 with default settings, go to:
Tools > Options > Environment > Keyboard.
Under "Show commmands containing:", type: Edit.SmartBreakLine
Then click Remove [Shortcut].
--
THEN, do same for "InteractiveConsole.BreakLine", and again remove the Shift+Enter shortcut.
Side effect on InteractiveConsole.BreakLine: After removing the shortcut, If you keep holding shift + enter to type a normal new line after removing InteractiveConsole.BreakLine, (without getting auto-complete-stuff), you won't get a new line.