Vscode: [Feature] Option to disable cmd+click trigger for goToDefinition

Created on 5 Apr 2017  Â·  27Comments  Â·  Source: microsoft/vscode

Starting ~2 weeks ago, I have been plagued by this feature. Somehow I manage to trigger this feature about 60% of the time when I am trying to copy+paste. It is the same issue as reported here, but in the editor so am creating this ticket as suggested by @bpasero .

https://github.com/Microsoft/vscode/issues/7827#issuecomment-238237206

  • VSCode Version: Version 1.10.2 (1.10.2)
  • OS Version: OS X 10.11.6 (15G31)

Steps to Reproduce:

  1. Cmd+click a followable definition.
  2. Unexpectedly arrive somewhere deep in node_modules.

Don't get me wrong, I love this feature but whatever changes were made recently seem to be incompatible with my muscle memory when copying text. So, I would like to change the keybinding, or at the very least turn it off altogether.

editor-core feature-request

Most helpful comment

dear vscode team,

PLEASE PLEASE PLEASE... allow us to disable the default behavior of ctrl + leftMouseButton (go to definition)

AND... PLEASE PLEASE PLEASE allow us to enable ctrl + leftMouseButton to do WORD selection exactly as it behaves in Visual Studio 2019/2017/2015.......

Thanks for your consideration!

All 27 comments

Cmd+click a followable definition.
Unexpectedly arrive somewhere deep in node_modules.

@nathanjd I am not sure I understand, how is this related to copy?

Apologies, this seems to be how I have been selecting text for copy:

  1. Double (word) or triple-click (line) text to select the text to copy.
  2. Press cmd+c.

However, it seems that 60% of the time I end up hitting cmd before the click. This may be because, in my head, this is all one near-instantaneous operation.

It's clear to me that I should train myself not to hit control until after the text is selected but it is proving a hard habit to break. I think that if given the option, I would change the goToDefinition shortcut to be alt+click or ctrl+click to remove the chance of accidentally colliding with my cmd based shortcuts.

Keyboard shortcuts are super important in OS X and I have changed quite a few so I would love the ability to remap ALL key bindings. It seems that most are accounted for in the "Keyboard Shortcuts", but goToDefinition and goToDeclaration only show as bound to f12.

Yes, I too would love to have a way to disable this. It's something I always have to turn off in full Visual Studio for anything that does it (ReSharper, Pro Power Tools, etc).

VS allows ctrl-click to select a word. vscode does not, however, I still instinctively try to do this, and the jumping around it causes is quite annoying.

I'm rather surprised there was not an option for it initially, as you guys are generally really on top of having feature toggles available for any new features.

I have the same thing happening as nathanjd, but trigger it in a different way. Doesn't happen often, but pretty annoying when it does.

How it happens for me:
1) Select text (left mouse button still held down)
2) Press Cmd (for Cmd+C) before letting go of the mouse button
3) Let go of mouse button

Seems like VSCode shouldn't "Go to link/definition" unless you press cmd first. After all it's Cmd+click, not select text+cmd

Yes! I want to disable hyperlinks in vscode so badly because every time I copy a link, I use cursor and cmd + c, then vscode determines that I use cmd + click to follow a link and open in browser. That drives me crazy! And I find no clue to turn off hyperlinks in vscode.
c_e64f1wsaeeiyt

Any update on this feature?
I used Cmd+Click all the time with VS2017 to select the whole word instead of double clicks because it's sooo much more faster and convenient. Am I the only one who actually used it?

Here the same situation. I don't know why anyone else thinks about it... :-( Very annoying...

I can't imagine why this isn't an option or rebindable. Near-unusably annoying.

Related: #3130, #34354, #27905

I also use Ctrl+Click to select whole word all the time in Visual Studio and it is very annoying that this behaviour cannot be customized in VS Code.

Is there any reason why this has been stalled so long?

Thanks.

Just wanted to add that, as @jkildedal mentioned, the gesture ctrl+click is generally and more conventionally used to select a word or token in Windows applications, full-fat Visual Studio included. I use it all the time in Visual Studio and the fact that it does something else in VS Code is extremely annoying. The fact that I can't disable the something else and have the conventional behaviour is doubly aggravating.

Please, please give us options.

It might be conventional to Windows and Visual Studio, but it's far from the standard..neither Eclipse, IntelliJ IDEA, nor Sublime Text use Ctrl+Click to select a word.

Agreed though, options/configuration will be nice to have.

Bump

Need this feature as well. I do Ctrl+Alt+click all the time by accident to use multiple cursors. Since it's Ctrl+Alt+up/down on the keyboard to add more cursors above/below, it makes total sense in my head that Ctrl+Alt+click also adds an extra cursor. But it doesn't.

It not only flies the editor to a place where I'm not working on atm, it also does so in a secondary (split screen) editor. Both are annoying, and both casue me to get ripped out of my flow.

Has this been fixed? It's crazy to me that a feature like this can't be disabled in an otherwise fantastically configurable editor.

dear vscode team,

PLEASE PLEASE PLEASE... allow us to disable the default behavior of ctrl + leftMouseButton (go to definition)

AND... PLEASE PLEASE PLEASE allow us to enable ctrl + leftMouseButton to do WORD selection exactly as it behaves in Visual Studio 2019/2017/2015.......

Thanks for your consideration!

AND... PLEASE PLEASE PLEASE allow us to enable ctrl + leftMouseButton to do WORD selection exactly as it behaves in Visual Studio 2019/2017/2015.......

But please only take the GOOD bits of VS20xx. It is mostly a shit editor, but it does have some good traits. I'm glad and disappointed at the same time, that two essentially identical editors (as in, the component where letters appear, not the whole program!) from the same vendor, can be so different. It's almost like Microsoft is becoming Adobe.

whenever I copy paste something I can get anywhere from 1 to 3 tabs opened with function definitions in my browser, it is really annoying to work with.
Any rebinding would be very much appreciated

Same problem here. I use Ctrl+Click to select words for copy and paste. More than happy to use the F12 key based shortcuts when I want to see definitions. It's the first thing I change in full VS when I do a new install.
Doing quite a bit in VS Code now and not being able to change this is very frustrating.

I changed the "editor.multiCursorModifier value to "ctrlCmd"

settings.json:

 "editor.multiCursorModifier": "ctrlCmd",

The "Ctrl+Click" then became a multiCursor trigger and "Alt+Click" became a goToDefinition

I changed the "editor.multiCursorModifier value to "ctrlCmd"

settings.json:

 "editor.multiCursorModifier": "ctrlCmd",

The "Ctrl+Click" then became a multiCursor trigger and "Alt+Click" became a goToDefinition

This triggers the Multi-Cursor on click and unfortunately is equally annoying..

Almost 3 years later in 2020 this is still an issue with no fix ... (4 years for crtl + click for select https://github.com/Microsoft/vscode/issues/3130)

This problem was enough to drive me away from VS Code. Let me know when it's fixed and I might use it again.

As an aside note, I also find go to definition hyperlink mode seems to get stuck on sometimes and you have to hit ctrl again to get it unstuck.

Hey!

I would also second ANY HACK/OPTION/WORKAROUND to disable Ctrl+Click to navigate. I would like just simple selection of text to work. I would even more appreciate that with Ctrl selection would select whole word under cursor. But I can live with simply disabling those links after Ctrl.

After using VS Community on windows recently I noticed the option is there. Please port it to the mac os version.

Thanks,
Antony

On 4/04/2020, at 11:30 PM, Wojciech Gebczyk notifications@github.com wrote:


Hey!

I would also second ANY HACK/OPTION/WORKAROUND to disable Ctrl+Click to navigate. I would like just simple selection of text to work. I would even more appreciate that with Ctrl selection would select whole word under cursor. But I can live with simply disabling those links after Ctrl.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

@Jav3k Thanks this works for me! @wgebczyk You should try @Jav3k solution above.

@Jav3k @purduemike That doesn't work when you want to hold ctrl and then "click word > C > click word > V", which is a fast way to select a word, copy it, select a different one, replace it. I can do this in traditional Visual Studio, and I do this really often, but it's pretty annoying that there's zero ways to configure VSCode to do this. I don't want to make this the default behavior, I don't mind configuring my editor to suit my needs, but this seems to be literally impossible right now...

Not 100% sure if this is relevant; but I was able to move the "go to definition" behaviour to requiring a different keypress (such as option instead of command)) by: VSCode Window > Selection Menu > Switch to Cmd+Click for Multi-cursor.

It does seem as though this button is not 100% accurate with its description. It is a toggle button that switches between the state Switch to Cmd+Click for Multi-cursor and Switch to Alt+Click for Multi-cursor. I have found that when the button displays Switch to Alt+Click for Multi-cursor, it requires you to click the option key instead of command - thus eliminating the odd accidental command+click "go to definition" behaviour before wanting to copy+paste text :)

Thanks @WillDawe , you are a champion

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NikosEfthias picture NikosEfthias  Â·  3Comments

omidgolparvar picture omidgolparvar  Â·  3Comments

villiv picture villiv  Â·  3Comments

v-pavanp picture v-pavanp  Â·  3Comments

lukehoban picture lukehoban  Â·  3Comments