Can't enter REPL paste mode in VScode? Just fix the keyboard shortcut conflict

VScode is a great tool, but what makes me laugh is that it basically takes up almost every keyboard shortcut I can think of and what I can’t think of.

Using MicroPython’s mpremote tool in the terminal of VScode, when I want to use the keyboard shortcut ctrl+E to enter the paste mode of the REPL, I find that it is occupied by VScode.

  1. In order to resolve the conflict, you need to set it in VScode’s File > Preferences > Keyboard Shortcuts, or use the shortcut key ctrl+shift+P and enter it in the pop-up search bar open keyboard shortcuts to access this option. 20220907173553

  2. Enter ctrl E in the search bar to find its related items, and find that the command that occupies the item is Go to File.... 20220907175434

  3. Right-click the item that occupies this shortcut key, left-click the Change When Expression item, enter !terminalFocus, and press Enter to confirm. This condition makes this command not valid in the terminal.

    20220907180050

  4. Use the mpremote tool in the terminal of VScode to enter the REPL of the development board, and use the shortcut key ctrl+E to enter the paste mode of the REPL normally. 20220907180935

  5. You can also use the shortcut key ctrl+shift+P and enter open keyboard shortcuts(JSON) in the pop-up search bar, edit this file, and add the following code:

[
    {
        "key": "ctrl+e",
        "command": "workbench.action.quickOpen",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+e",
        "command": "-workbench.action.quickOpen"
    }
]

video demo: