unable to type in Visual Studio Code - 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.

Related

DOCTYPE Emmet shortcut stopped working VS Code [duplicate]

Every other snippet is working, but !+tab is not.
! snippet is not working
other snippet is working
I am using Visual Studio Code. I'm using 1.69.0. It was working before, but I wanted to add net html file, named that new.html, because I had index.html already. After that this script stopped working on every html file, but other scripts like "a", "div" etc. is working.
The v1.69.2 recovery release is out now. Emmet in html is working as it should for me now.
Looks like it will be in the Recovery Release, see https://github.com/issues?q=is%3Aissue+label%3Acandidate+repo%3Amicrosoft%2Fvscode+repo%3Amicrosoft%2Fvscode-internalbacklog+repo%3Amicrosoft%2Fvscode-remote-release+milestone%3A%22June+2022+Recovery+2%22+.
Don't know when the recovery release to Stable - presumably v1.69.2 - will be released. The .1 release is out and the fix is not in it.
It has been fixed though, see https://github.com/microsoft/vscode/issues/154375, and should be in the Insiders Build tomorrow (07/13/2022).
Testing the latest Insiders: ! is working. As is ul>li*3 type expansions (although that never stopped working for me - but it has been reported elsewhere). Should be in the v1.69.2 release out soon.
It is a known issue with the v1.69 release, see html emmet suggestion not automatically display or https://github.com/microsoft/vscode/issues/154517 for example. Lots of issues on github on ! and * not working.
So the emmet snippet will not appear automatically when you type !, but you can press Ctrl/Cmd+Space (which is the command Trigger Suggest) to make it appear and select normally.
Try Ctrl/Cmd+Space for anything emmet-related nnnnnot working in vscode v1.69.
You could also go back to v1.68 to solve the issue.
Try to write "doc" instead of "!". "doc" works for me.
On Windows 10, this worked for me:
Go to "Settings" and type "emmet.trigger" in the search
A checkbox for "Emmet: Trigger Expansion On Tab" will appear
Check the checkbox for allowing Emmet to trigger expansion on tab
After I did that, it worked just fine for !+TAB and any type of mulitpliers (i.e. li*4+TAB).
You need to check this option or put "emmet.triggerExpansionOnTab": true in settings.json to use the emmet abbreviation pressing TAB. I realized this ones what is not working:
!, lorem, >, and .
Examples of use: ul>li, li3, ul>li*3
None of them shows the preview of the emmet, and you can't use them pressing TAB without enabling the option that I sayed above, and even checking the option you won't be able to see the previews, you'll need to know them by yourself and press the TAB even though nothing showing that it's a emmet abbreviation.
You can use CTRL + SPACE too.
Edition Windows 11 Pro
Version 21H2
VSCODE Version 1.69.0
I had the same issue with the ! not working. I found another shortcut that does the same thing: type html:5, and press enter.
Looks like a bug, I have the same problem with 1.69.1, the VSC team is aware and fixing it. Should be fixed with the next release soon.
Meanwhile, you can use either HTML:5 or doc
meanwhile use "HTML:5"
enter image description here
or use "doc"
enter image description here
While #Mark's answer works, another work around would be to use the html:5 snippet which still works as expected in v1.69
Yes, I am facing this issue too since the latest update.
Somehow the solution I have got is :
You can check the box “Emmet: Use Inline Completions”
In settings by typing “emmet” in the setting’s search.
You can see the suggestion now and choose it by pressing the tab.
This is the solution I have got till now but hoping that we could have the previous version back.

Emmet html5 boilerplate shortcut not working as before [duplicate]

Every other snippet is working, but !+tab is not.
! snippet is not working
other snippet is working
I am using Visual Studio Code. I'm using 1.69.0. It was working before, but I wanted to add net html file, named that new.html, because I had index.html already. After that this script stopped working on every html file, but other scripts like "a", "div" etc. is working.
The v1.69.2 recovery release is out now. Emmet in html is working as it should for me now.
Looks like it will be in the Recovery Release, see https://github.com/issues?q=is%3Aissue+label%3Acandidate+repo%3Amicrosoft%2Fvscode+repo%3Amicrosoft%2Fvscode-internalbacklog+repo%3Amicrosoft%2Fvscode-remote-release+milestone%3A%22June+2022+Recovery+2%22+.
Don't know when the recovery release to Stable - presumably v1.69.2 - will be released. The .1 release is out and the fix is not in it.
It has been fixed though, see https://github.com/microsoft/vscode/issues/154375, and should be in the Insiders Build tomorrow (07/13/2022).
Testing the latest Insiders: ! is working. As is ul>li*3 type expansions (although that never stopped working for me - but it has been reported elsewhere). Should be in the v1.69.2 release out soon.
It is a known issue with the v1.69 release, see html emmet suggestion not automatically display or https://github.com/microsoft/vscode/issues/154517 for example. Lots of issues on github on ! and * not working.
So the emmet snippet will not appear automatically when you type !, but you can press Ctrl/Cmd+Space (which is the command Trigger Suggest) to make it appear and select normally.
Try Ctrl/Cmd+Space for anything emmet-related nnnnnot working in vscode v1.69.
You could also go back to v1.68 to solve the issue.
Try to write "doc" instead of "!". "doc" works for me.
On Windows 10, this worked for me:
Go to "Settings" and type "emmet.trigger" in the search
A checkbox for "Emmet: Trigger Expansion On Tab" will appear
Check the checkbox for allowing Emmet to trigger expansion on tab
After I did that, it worked just fine for !+TAB and any type of mulitpliers (i.e. li*4+TAB).
You need to check this option or put "emmet.triggerExpansionOnTab": true in settings.json to use the emmet abbreviation pressing TAB. I realized this ones what is not working:
!, lorem, >, and .
Examples of use: ul>li, li3, ul>li*3
None of them shows the preview of the emmet, and you can't use them pressing TAB without enabling the option that I sayed above, and even checking the option you won't be able to see the previews, you'll need to know them by yourself and press the TAB even though nothing showing that it's a emmet abbreviation.
You can use CTRL + SPACE too.
Edition Windows 11 Pro
Version 21H2
VSCODE Version 1.69.0
I had the same issue with the ! not working. I found another shortcut that does the same thing: type html:5, and press enter.
Looks like a bug, I have the same problem with 1.69.1, the VSC team is aware and fixing it. Should be fixed with the next release soon.
Meanwhile, you can use either HTML:5 or doc
meanwhile use "HTML:5"
enter image description here
or use "doc"
enter image description here
While #Mark's answer works, another work around would be to use the html:5 snippet which still works as expected in v1.69
Yes, I am facing this issue too since the latest update.
Somehow the solution I have got is :
You can check the box “Emmet: Use Inline Completions”
In settings by typing “emmet” in the setting’s search.
You can see the suggestion now and choose it by pressing the tab.
This is the solution I have got till now but hoping that we could have the previous version back.

VSCode some shortcuts not working properly

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.

How can I show code error in VSCode by hovering over it

Today, I was watching a video tutorial. The tutor did a minor mistake in his code and while he was trying to find out what the mistake was, he hoverd over the code and exactly at the place, where his error was, VSCode popped up with an Error message like this:
Does any one know how can I activate this in my VSCode? Do I need to install an extension?
The setting is called "Editor > Hover: Enabled". You can search for it in the VSCode settings and make sure the box is checked to enable it.
this should be a built in feature but may need enabling it..
more info at
https://developercommunity.visualstudio.com/content/problem/249839/vs2017-1571-no-values-on-hover.html

VSCode Vim extension to search for visual mode selected text

In vim I can search for a visually selected string using a number of techniques including what can be found here:
http://vim.wikia.com/wiki/Search_for_visually_selected_text
Is there a way to do the same thing in VSCode with the Vim extension?
Right now, VsCodeVim doesn't support the command in search mode, so that keybinding isn't possible.
If you want to see that in the future, opening an issue at https://github.com/VSCodeVim/Vim/issues would help.
EDIT: https://github.com/bronson/vim-visual-star-search is implemented, so this functionality is now there.