29

I want to know if it's possible to remove the key bind on Ctrl-Click for the goToDefinition (F12) editor action.

This is so annoying, every time i try to Ctrl+C/V it trigger and go to the definition cause I'm holding Ctrl while I'm highlighting the code with my mouse.

I have search for it on google but all y can change is the F12 key bind for goToDefinition which is not what I want.

--- Update

This is the feature I want to disable

enter image description here

I need to remove the ctrl+click key bind. Even if I replace it, it doesn't work.

-- Update 2

I finally found something on the subject Here

But for me it doesn't work at all.

-- Update 3

Created a new issue on GitHub (#7827) Look at it if you wanna see the update on the request.

JMP
  • 4,417
  • 17
  • 30
  • 41
WoofWoofDude
  • 617
  • 1
  • 7
  • 13
  • 2
    For fellow searchers, the Github issue was closed as it was specific to this copy-paste bug. The overaching feature of disabling Ctrl-Click is at: https://github.com/Microsoft/vscode/issues/23957 and has not been fixed at time of writing. – Slate Sep 14 '18 at 10:59
  • Agreed. https://github.com/microsoft/vscode/issues/23957 offers comments explaining best alternative temporary workaround for the time being (Selection -> Switch to Ctrl Click for Multi Cursor) – Fortmann Sep 03 '20 at 14:41
  • To be honest, until about 2 years'ish (give or take a couple months) I liked JetBrains WebStorm, IntelliJ, and CLion, as my Dev Env's of choice. Today, I use V.S. Code for almost everything, as it gives me control and access to a broad range of technologies & features without having to use multiple different IDE's. It has the most modern features of any IDE or Editor, Its the Jack knife of Dev Env, however, JetBrains still to this day, does somethings that VS Code hasn't implemented yet, one being Mouse click keybindings. – JΛYDΞV Oct 31 '21 at 04:44
  • Does anyone know how to ctrl click into a vue component and have it actually take you to that file rather than just show definition? – CodeConnoisseur Jun 24 '22 at 21:26

4 Answers4

6

At the time of writing (2022) you can turn off this with workaround by setting following setting to 'ctrlCmd'.

enter image description here

How to open setting page in vs code?

Ctrl+Shift+P and enter open setting (UI) enter image description here

Wappenull
  • 1,181
  • 13
  • 19
  • more details on this solution can be found here: https://code.visualstudio.com/docs/editor/codebasics – Nate Aug 22 '22 at 21:20
  • After an update rendered the default "go to definition" key binding not working, changing this setting to `alt` did the trick. Thank! – christopher.theagen Dec 27 '22 at 15:09
3

There is a VS Code feature request for this on GitHub, under the more general heading Allow customization of mouse shortcuts.

Anyone interested in this VS Code feature should comment/vote there. (The Ctrl-click-specific GitHub posts have been closed off and linked to this one. Ex. #16974)

starball
  • 20,030
  • 7
  • 43
  • 238
Reg Edit
  • 6,719
  • 1
  • 35
  • 46
0

Fastest way:

  1. Press F1 (opens search bar).
  2. Search multi-cursor modifier
  3. Just press the toggle appearing as the search result.

enter image description here

OfirD
  • 9,442
  • 5
  • 47
  • 90
-2

Add the following lines in keybingings.json to disable (actually override default behaviour) mouse+ click

[
    { "key": "ctrl+[mouse button]",   "command": "cursorWordLeft",
                                         "when": "editorTextFocus" }
]

To open key bindings file, traverse

File > Preferences > Keyboard Shortcuts

enter image description here

Pandiyan Cool
  • 6,381
  • 8
  • 51
  • 87