32

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.

4
  • 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: github.com/Microsoft/vscode/issues/23957 and has not been fixed at time of writing. Commented Sep 14, 2018 at 10:59
  • Agreed. 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) Commented Sep 3, 2020 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. Commented Oct 31, 2021 at 4: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? Commented Jun 24, 2022 at 21:26

4 Answers 4

8

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

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

2 Comments

more details on this solution can be found here: code.visualstudio.com/docs/editor/codebasics
After an update rendered the default "go to definition" key binding not working, changing this setting to alt did the trick. Thank!
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)

Comments

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

Comments

-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

5 Comments

maybe i do it wrong.. Should i change [mouse button] by left or right ?? cause when i write the exact same thing as you it doesnt work :/
Already tried and it doesn't work like i said. When i ctrl+mouseUp/Down it go to def... I have updated my original post with more details @PandiyanCool
ATM VS Code has no support to configure the mouse behaviour. This answer is not correct
This answer used to work for me but no longer works. VSCode must have removed this feature =/
Someone downvoting this answer after 4 years. :) VSCode itself might have dropped that feature. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.