How to set the keyboard shortcut in vscode to alt + left_click for placing multiple cursors?
I could not find it in the 'keyboard shortcuts' section.
I found one named createCursor but couldn't add any mouse input.
You set the modifier in your settings.json or with the GUI
editor.multiCursorModifier
search for multi cursor in the GUI
Related
In sublime text I used to use a shortcut that allowed me to tab through my multi selection and edit each element individually.
for example I would cmd+d a word then the shortcut would allow me to tab through each selection and edit them individually.
I haven't used sublime text in a month since I switched and can't even remember the shortcut I used to find the name of that action. so I don't even know if it was a plugin or a built in short cut.
is there a similar shortcut in vscode?
You can multi-select in VSCode using alt+click
(can be changed to cmd+click in "Selection -> Switch to Cmd+Click for Multi-Cursor").
To tab through your selections install the tab-through-selections extension and then use cmd+shift+u to start iterating (alternativley ctrl in Windows), then:
tab to go to the next selection
shift+tab to go to the previous selection
click anywhere to cancel iterating
Hope this helps :)
When using ctrl + alt + click to do multiple select in vscode, sometimes it works but, most of the time it doesn't. When I try to edit keyboard shortcuts, I cannot find this shortcut anywhere. I only see the add cursor above ctrl + alt + UpArrow and add cursor below ctrl + alt + DownArrow, which does work in my case, but I'm trying to edit in places that aren't aligned.
I see small diamond with cross to the upper right of my cursor sometimes.
The default keybinding is Alt+Click.
Which can be changed in the settings: Editor: Multi Cursor Modifier to Ctrl+Click if you wish.
The underlying command is createCursor which is unbound by default. You can add a keybinding in the Shortcuts Editor when you find createCursor - but you cannot add mouse clicks to a keybinding.
Toggle Multi-Cursor Modifier is not what you want, it just toggles between using Alt+Click or Ctrl+Click to add cursors.
If Alt+Click doesn't work, try Ctrl+Click it may have already been toggled (or the setting I mentioned above Editor: Multi Cursor Modifier already changed from the default Alt).
Look for the createCursor command in the Gear Icon/Keyboard Shorts editor. Then hover over it and click the + that appears to its left. In the input box that opens you can enter a new keybinding.
But as I said before, you cannot make a keybinding that uses mouse clicks. You will have to chose another keybinding.
In sublime text I used to use a shortcut that allowed me to tab through my multi selection and edit each element individually.
for example I would cmd+d a word then the shortcut would allow me to tab through each selection and edit them individually.
I haven't used sublime text in a month since I switched and can't even remember the shortcut I used to find the name of that action. so I don't even know if it was a plugin or a built in short cut.
is there a similar shortcut in vscode?
You can multi-select in VSCode using alt+click
(can be changed to cmd+click in "Selection -> Switch to Cmd+Click for Multi-Cursor").
To tab through your selections install the tab-through-selections extension and then use cmd+shift+u to start iterating (alternativley ctrl in Windows), then:
tab to go to the next selection
shift+tab to go to the previous selection
click anywhere to cancel iterating
Hope this helps :)
I do not like the Visual Studio multi cursor options, and I never use them.
Inevitably, I phantom-pressing some key combination that brings up a multi cursor option, then I write some code, and then the code is destroyed afterward. Please tell me how to completely disable all such functionality in Visual Studio Code. I am running on Ubuntu, but also interested in how to accomplish this on Windows (if there is any difference).
I should mention, that this happens literally once every 5 minutes to me on Ubuntu, but in Windows it happens much less frequently (like once an hour).
Un-check Selection->Column Selection Mode
You can remove the keyboard shortcut(s) that trigger this functionality.
Click on the gear on the bottom-left corner of the window and choose "Keyboard Shortcuts" from the menu. Type "Add Cursor" into the "Search" box and it shows only the commands that contain "Add Cursor" in their name.
Right-click on each command that add a cursor and has a keyboard shortcut associated and select "Remove Keybinding".
Also search for "Multi-Cursor". It could return the command "Toggle Multi-Cursor Modifier" that is associated to a combination of modifier keys (one or more of Ctrl, Alt, Shift). If such a combination of keys is pressed when you click in the editor window it adds a new text cursor at the click position. You should also removed these key bindings.
Set this settings in editor settings :
"editor.columnSelection": false,
In Android Studio :
Un-check Selection->Column Selection Mode
I use the keyboard shortcut for Find in Files (CtrlShift+F), and use other hotkeys, like Alt+R to toggle regex matching on/off (though I wish they'd used the same shortcuts as Visual Studio!
In Visual Studio you can jump to the File Types input with Alt+T, but I can't figure out a way to do it in VS Code, I have to resort to pressing Tab 5 times. Anyone know the keyboard shortcut to jump directly to that input?
New answer:
Up/down arrows now navigate the history of each search field. You can use cmd+up/down to switch between the inputs.
Original answer:
You can use the up/down arrows to switch between these inputs.
VSCode 1.70 (July 2022) adds a related feature:
Search Editor: Allow Keyboard Shortcut for File to Include/Exclude
In the search editor, there is search.action.focusQueryEditorWidget to focus on the query.
I'd like to be able to set a keyboard shortcut to focus on "files to include" and "files to exclude".
Fixed with PR 153954
This adds keybindings to quickly focus on files to include/exclude.
I tried to follow the pattern for the toggle X keybindings, so I went with:
Cmd+Alt+F and
Cmd+Alt+Shift+F.
I used "F" for "files".
This is available in VSCode insiders today.