Multiple Caret in vscode for Windows - visual-studio-code

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.

Related

In VSCode, the Shift+Space Hotkey doesn't actually work when the typing caret is inside the terminal

This shortcut is suppose to Maximize or normalize the size of the terminal, but it only works when the mouse cursor is active outside the terminal.
It doesn't work when the typing caret is active inside the terminal.
Is there a workaround?
Just Go To Files > Preferences > Keyboard Shortcuts
Search for: View: Toggle Maximized Panel
Change The Keybind whatever you like
I set that to Ctrl + Alt + 1
for more information and more shortcuts see this link

placing multiple cursor on the vscode for linux?

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

How do I trigger suggestion(s) in VSCode in Catalina?

This tells me that I could use ⌃ + Space combination in order to display suggestions for my code. However, ctrl + Space ( ^ key is ctrl as far as I know) only seems to change the input language keyboard in my system. Nothing else seems to work.
Try Option + Escape, on mac.
The mac keyboard shortcut ctrl + space for switching input sources overrides the VSCode one. Because of this, VSCode added a new keybinding just for mac, Option + Escape
This is actually called intellisense, and the new keyboard shortcut was added in the November 2019 update.
You can disable the macOS shortcut in System Preferences → Keyboard → Shortcuts.
Alternatively you can set up a custom keybinding for this command in VS Code, so that it no longer conflicts with your system shortcut. Please refer to the official documentation.
Recently, ⌘I (i.e. command + i) is also a by default key binding for triggering suggestions.
On MacOS Ventura,
Go to System Settings
Select Keyboard on the Left panel
Select "Keyboard Shortcuts"
Select Input Sources and toggle the switch labelled "Select the previous input source".
Quit vscode and relaunch

Visual studio code: CTRL + B => "edt " at the top bar

I was trying to figure out how to toggle the side bar, and apparently ctrl + b is the way to do it, but when I perform it, it opens up the that input bar in the middle of the top portion of the editor, just below the menu bar, with "edt " (including the space) typed in.
My keybindings.json file shows that I should ctrl+b should indeed toggle the side menu.
If I delete the "edt " and press ctrl+b, it just regenerates it.
Anyone know how to fix this? Nothing shows up on Google either.
ctrl + b is bound to Add Function Breakpoint by default. You can edit the shortcuts from File->Preferences->Keyboard Shortcuts.
File > Preferences > Keyboard Shortcuts will show you a list of shortcuts.
You can search for Toggle Side Bar Visibility or workbench.action.toggleSidebarVisibility to see what the current shortcut bindings are, and edit them.
Mine were also showing the edt behavior you described, and were set to accept Ctrl + \ as well as Ctrl + K Ctrl + B for toggling the side bar visibility. Ctrl + \ may be worth trying out if you do not want to go through the hassle of finding a new non-clashing key combination to set as the shortcut.
If you see edt, it is because ctrl+b is bound by default to View: Show All Editors By Appearance.
As others have mentioned, use File > Preferences > Keyboard Shortcuts (or find it in the command palette with ctrl+p), then search for "Show All Editors By Appearance" and remove that key binding.
You may also remove any other ctrl+b bindings there, if they're in your way by searching for "ctrl+b".
Ctrl+B is normally worked in toggling sidebar in Visual Code, but some extensions prevent it, because ctrl+b is used in these extensions as a shortcut.
To solve this problem:
You should go to
File > Preferences > Keyboard Shortcuts
and then, you will change the shortcuts used as ctrl + b
View: Toggle Side Bar Visibility

Visual Studio Code - Shortcut - Collapse all files in explorer

Can you anyone provide the shortcut for collapse all files in visual studio code explorer?
I personally prefer not to create new shortcuts. As #Mark pointed out on the answer of #JayChase there is an existing shortcut, but it requires the explorer to be in focus. Therefore I combine the shortcut mentioned by #JayChase with another standard shortcut, to get the desired behaviour.
command + 0 (focusses on explorer).
command + left-arrow
An additional benefit over this approach is that I usually want to focus on the explorer view if I want to collapse the folders.
Open the Keyboard Shortcut by pressing Ctrl + K then Ctrl + S and search for Collapse, you will see the Collapse Folders in Explorer key binding (It is empty by default). Press the + button to add your desired key binding.
Now you can enjoy your shortcut.
it's cmd/ctrl + shift + up-arrow
You can collapse all folders using cmd/ctrl left-arrow.
First, click anywhere in the explorer window to activate it, then use the shortcut.
On Windows and Linux.
Ctrl + Left arrow
On Mac:
⌘ + Left arrow
When the Explorer is active, you could use the Workbench list based shortcuts. list based shortcuts include collapse, collapse all, expand, expand all, toggle expand/collapse
To see what are the shortcuts open Keyboard Shorcuts -> Search for list. . Here you find shortcuts for collapse, collapse all, expand, expand all, toggle expand/collapse. These shortcuts work when the Explorer is active, as the Explorer works as a list.
Below is a screenshot for Mac.
If you would like to define a shortcut, without activating the Explorer, then I would recommend - cmd+k ctrl+c. You could add this by opening Keyboard Shorcuts -> Search for Collapse Folders in Explorer -> Click the edit button after hovering over the the Command you want to edit.