VSCode some shortcuts not working properly - visual-studio-code

latest version 1.40.1 on Windows 7 x64. I am developing in Java.
The most common shortcut, "go to definition" F12 and "auto fix" ctrl+dot
I tested it on another computer with 1.40.1. It works properly.
I have follow the key binding troubleshooting guide. When I record my key ctrl+dot.
It shows ctrl+oem_period. Looks like the OS is sending the correct keys to VSCode.
I couldn't find a way to reset VSCode key bindings and do not know what is actually causing this.
What should I do next? Completely reinstall everything is the last resort.

With the command Developer: Toggle Keyboard Shortcuts Troubleshooting, you can see which command is linked to a shortcut. It could happen that an extension is overriding the expected behaviour.
For example, I had an extension overriding the shortcut to reopen a closed tab, which didn't work anymore.

This resolves my issue:
Change your "keyboard.dispatch" to keyCode in the file settings.json
{
"keyboard.dispatch": "keyCode"
}

Your operating system keyboard shortcut is overriding the vscode shortcut. You should check your operating system shortcut key instead.

Just restarted the Visual Studio Code and the keys are working fine.

I was facing the same problem after I updated my Intel Graphics Command Center using Windows Updates.
The Add One Cursor Above/Below shortcuts were not working for me.
I started the Intel Graphics Command Center, and then went to System > Hotkeys tab, Enabled System Hotkeys as shown in the picture below.
I flipped my screen a couple of times using the keyboard shortcuts and then disabled once again.
Then switched back to VSCode and the keyboard shortcuts were working!!

In my case, "cmd+k cmd+0" which helps to fold all regions was not working.
Another extension was using the same shortcut. I followed the steps below to fix it.
Here are the steps to fix this
Press "cmd+shift+p" to open command palette
Type "Preferences: Open Keyboard Shortcuts" and hit enter
Press "option+cmd+k" to start recording keys.
Press the short cut keys that are not working (in my case "cmd+k cmd+0" ). This will list all the instances of that shortcut keys. And there are probably multiple instances of the same keybindings with some of them being used by an "Extension" as shown under the "Source" column.
Remove that and keep only that instance which says "Default" under "Source" column.
Now, you should able to use the default keyboard shortcuts.

Resolved :
Facing similar issue. Several keyboard shortcuts stop working when code starts running.
In my case it was happening because of notepad++ extension. Disabling that extension resolves the issue.

Sometimes this can happen because of change in environment variables. Please check if any recent program installations has made that change

You may also need to check the when clause of the Keybinding. In my case, I was struggling with why "Command+R" wasn't reloading the window on my Mac. By right-clicking on the row of the relevant command in Keyboard Shortcuts, then clicking "Change When Expression" and removing the expression completely, the keybinding now works as expected.
Source: https://github.com/microsoft/vscode/issues/108393#issuecomment-706215895

Try turning on Num Lock, it worked for me.

Extensions you add to VSCode also can override the ordinary behavior of shortcuts. I faced to this problem, I've noticed that the ordinary shortcut command + L which selects the whole line, does not work, and the reason was Live Server extension, which overrides that shortcut, after its deletion shortcut became work properly

I have tried many methods to solve this problem ,not every problem of mine got solved so I use this method after I cant find the solution.
you can first uninstall the VS code and then delete the .vscode file from C=>user=>admin=>.vscode
after that reinstall vscode ,from my end its working fine after doing this.

My issue is niche but never know, might help someone - YouTube Music Desktop player app was hijacking cmd, shift + l for me.

In my case, my Ctrl keys were mapped to the Toggle extension and this extension could not overwrite one of my settings in the settings.json because I had pending changes that hadn't been saved. Once I saved the file, I was able to use the toggle keyboard binding again. I used the guidance from Martin above to determine the cause of the issue.

99% works.
Forget everything that may overrides your keyboard shortcuts. The problems is your keybindings.json file, if you fix it you'll fix your problem.
I found the solution and I've explained it in the following link:
Why vscode shortcuts don't work properly?

Woo, found my issue was Razor Naga stuff. After I updated some of the Razor apps (it has Synapse, Cortex, etc), this issue started happening. Now, I saw these apps are running in the background although I am not using the devices at this time, and once I quit them, VSCode went back to normal thankfully.

In my case, I have installed some "vim keyboard extensions" and others. so I have uninstalled all the extensions related to the "keyboard" i.e. "vim keyboard extension" and now it is working fine. it is recommended to check if you have downloaded any extensions for the "keyboard" in the extensions and uninstall it. It might solve the issue.

This worked for me to fix CTRL+Space "Trigger Suggest". First I found and disabled this setting in: System Preferences > Keyboard > Shortcuts > Input Sources
Then I followed #ryandidevar's instructions and replaced everything for Mac: https://stackoverflow.com/a/72187880/14353462
Finally, I set "Trigger Suggest" in VSCode > Preferences > Keyboard Shortcuts to: CTRL+§ (which is right next to my "Z" key). CTRL+Space just would not be accepted under any circumstance. Now hitting CTRL+§ finally brings up the suggestions!

MacOS users,
This is a default macOS shortcut. VSCode is never getting the meta+shift+L message from your OS. Your OS is hijacking it. You need to disable it.
System Settings > Keyboard > Shortcuts > Services > uncheck: Search with Google
Source: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000435950/comments/360000170990
This is a default macOS shortcut, you can disable it at System Settings | Keyboard | Shortcuts | Services| Search with Google.
https://apple.stackexchange.com/questions/180038/strange-behavior-within-ms-word-using-command-shift-l-launches-safari-sometimes

I just deleted folder in %APPDATA%\Code\ resets whole vs code and fixed my problem with alt + b and other vs code shorcuts not working

For me, It is the keyboard layout setting that causes this. Use English US keyboard setting.

Related

VS Code with Vim extension: ctrl+d does not go half a page down but instead goes to "Select Environment"

I checked VS Code shortcut bindings, but do not see why "ctrl+d" will open "Select Environment" instead. That does not even appear in the shortcut bindings. Any idea how I can make it go half a page down instead?
I'm assuming you're using the Vim extension and expect it to page down.
If you select one of the environments (like Node.js for me), it should work after.
In case someone ever met this problem again, I solved this problem by entering command mode (press :) and escape.
I still am not sure what happened.

VSCode Shortcut Ctrl+Shift+e renders as unknown instead of navigating to explorer window

I am trying to navigate to the explorer window via Ctrl+Shift+e but this sequence of keystrokes is not recognizable by VSCode 1.55.2.
I checked this two ways. First, via trying to check what Ctrl+Shift+w and Ctrl+Shift+e were binded to via keyboard shortcuts (Ctrlk, Ctrls) and then recording the keystrokes to reveal what they were binded to.
You will observe that ctrl+shift+w is recognized. Then, in the gif, when I press ctrl+shift+e it renders as ctrl+shift+unknown.
Then, whenever in a saved open file in the editor, when I press ctrl+shift+e hoping that the explorer navigator opens up on the left, that does not happen. Instead the file becomes unsaved with an underscore e appearing in the file.
This is completely new and strange behavior of the editor. I did not encounter this before.
Any help is appreciated.
Edited to add update: VSCode folks indicate that this is a known issue. Ctrl+shift+e translates into insertion of an emoji, it seems. See their comment here.
Same thing happened to me, using linux (ubuntu).
I installed it from the snap store, and tried reinstalling from there and the problem was still there.
Uninstalled and installed it manually from de .deb package at their webpage and it was solved.
Maybe it's an issue they have solved in the latest version (1.15.8) but it's still unsolved in the snap version (1.15.2 in your case, i didn't pay attention on what was my version).
Same problem. Installing vscode from .tar.gz - works perfectly fine, installing from snap leads to unexpected behaviour on Ctrl+Shift+E

Hide other windows (CMD + Option + H) shortcut for VS Code on macOS

In proper mac applications you can use command+option+H to hide all apps except the currently active program. This does not work in VS Code for some reason. Is there a way to get this functionality?
You could try this I found setting each app individually worked for me.
Senario
I wanted to prevent vscode from using Hide Visual Studio Code which, by default was mapped onto cmd+H keyboard shortcut. I changed it to the way illustrated in the screegrab and it worked. Perhaps you could do the same?
Edit
I actually attemped it and it worked with the same combo you wanted. See the screen grab below:
Happy coding =)

unable to type in Visual Studio Code

people from StackOverflow. I have a very frustrating experience with VS Code. At the moment of starting a new file, a mode starts on the editor that makes me being unable to type anything. Here is a youtube link from me, trying to type something.
Unable to type characters in VScode
Please, tell me, what should I do?
press control+C, then press "i" to get in the "insert" status, you could edit your file now.
It looks like you have the Vim extension, or another extension, installed which is causing this. I see SURROUND INPUT MODE in the status bar which is probably the cause. Look at your extensions and see whether you need to disable or uninstall one, or start Code with --disable-extensions flag to disable them all.
I have been having the same problem caused by a plugin called vim (vim emulation for Visual studio code)...If it can help..
I had the same issue so I look up to Visual Studio Extensions and Disabled Vim extension then I can now edit my code anytime.
I had the same issue which was caused by the vim extension. Just go to extensions and type in vim, if it's installed clicked uninstall then reload/refresh vscode. This worked wonders for me.
Just press "i" on your keyboard, it should work!
You can disable this by starting with the letter i while your file is opened and with the cursor at any point on your file. Tapping i on your keyboard should immediately take you back to insert mode.
Challenge with this: You have to do it for every file before you start typing.
This is probably the VIM extension. You can keep the extension, all you need to do is command + C then i. the i is to get into insert mode.
To completely solve this problem, you may have to uninstall or disable VIM as an extension
Had the same problem. all I had to do was disable the vim extension install in my vscode
Disabling vim plugin in VS code helps.

Does VS Code has any shortcut like ctrl+q in eclipse?

Does VS Code (I currently use v1.8.1) has any shortcut like ctrl+q in eclipse?
It returns your cursor to the place where you stopped writing code(very useful for fast code browsing)
and it is different to alt+left which navigate backward
EDIT: I have found that this extension should do that you're asking. I suggest trying it out.
Original:
Out of the box in VS Code, this command does not exist. The list of default shortcuts can be found here, or you can open the keybindings settings in VS Code (ctrl+k, ctrl+s on Windows) and see which commands are available.
If you'd like to suggest this as a feature, you can open a new issue on GitHub or consider creating an extension.
If I understand correctly, you want a command that will move the cursor to where the last edit in a document was made.
This should be possible using an extension that listens to document change events and records the position of the cursor. Then, when the command is issued, it sets the editors cursor to that saved position.
You can also try "Eclipse Keymap" from Alphabot Security, has a lot of eclipse bindings.
I don't believe there is a built-in way to do this, but you could work around it by using an extension such as https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks .