Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remap the `Alt+Click` action in visual studio code?

according to the documentation here I can add multiple cursors in visual studio code by using alt+Click in the editor. Sadly alt+drag is already used by the window manager to move the window around, so visual-studio-code does not get any key events. So how do I change that keyboard configuration in visual studio code? I could not find anything in the default key combinations file.

I am not looking for solution that changes my window manager, I really like that behavior and use it very frequently already for a very long time.

like image 931
Arne Avatar asked Jul 25 '16 12:07

Arne


People also ask

How do you change key bindings VS Code?

Click File -> Preferences -> Keyboard shortcuts. Use the tab that opens up to edit and find available key bindings and assign them.

How do I customize keyboard shortcuts in Visual Studio?

On the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard. Optional: Filter the list of commands by entering all or part of the name of the command, without spaces, in the Show commands containing box. In the list, choose the command to which you want to assign a keyboard shortcut.

How I can make Ctrl Click to go to definition in Visual Studio Code?

Go to Definition# If a language supports it, you can go to the definition of a symbol by pressing F12. Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.

How do you switch between tabs in code?

You can switch between views using ctrl + 1 ( ⌘ + 1 ), ctrl + 2 ( ⌘ + 2 ), and so on. Alternatively, you can switch between tabs (and, by extension, between views) using ctrl + page up / page down ( ⌘ + page up / page down ).


2 Answers

The easiest way in my opinion is:
From the top-level menu, click on

Selection -> Switch to Ctrl+Click for Multi-Cursor

Then you can use Ctrl+Click rather than Alt+Click.

You can see where this is in this screenshot: You can see where is this in this screenshot

My VSCode version is 1.24.1

like image 69
Marcelo Pereira Rodrigues Avatar answered Oct 03 '22 13:10

Marcelo Pereira Rodrigues


There is currently no way to do this but already an open issue on GitHub which addresses that.

like image 30
DAXaholic Avatar answered Oct 03 '22 15:10

DAXaholic