Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I turn off or remap ctrl + left click in Visual Studio Code

Does anyone know how I can turn off or remap Ctrl + left click in Visual Studio Code? I seem to have the Ctrl key depressed when selecting text with my mouse to copy about 20% of the time, and it is really annoying to navigate to another file in the middle of it.

Visual Studio Code - Key Bindings

like image 710
sky-dev Avatar asked Sep 18 '25 15:09

sky-dev


1 Answers

I took a quick peek at the VS Code keyboard shortcuts documentation and found a list of accepted keys.

enter image description here

Usually you would go to File > Preferences > Keyboard Shortcuts and add your custom bindings like so:

(this is the keybindings.json file found @ C:\Users\[user]\AppData\Roaming\Code\User)

// Place your key bindings in this file to overwrite the defaults
[
    { "key": "f8",                    "command": "workbench.action.tasks.build" },
    { "key": "ctrl+[mouse button]",   "command": "cursorWordLeft",
                                         "when": "editorTextFocus" }
]

But unfortunately, according to the documentation, mouse rebinding seems unsupported.

That being said VS Code is an open source project so you could always propose this feature or pitch in and see what you can do!

Here's the config file for the editor. https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/config/config.ts

like image 134
Alexandre Michel Avatar answered Sep 21 '25 06:09

Alexandre Michel