VS Code Version 1.36.1 for Mac.
Every time when I open VSCode, the word wrap is on. I have to ⌥+Z to turn it off. Whenever I close VSCode and reopen it, I have to do this again.
While in the Settings, either in User or Workspace, Editor: Word Wrap is off.
What am I doing it wrong? How to fix it?
I still encountered this issue in v1.64.2 on MacOS. I found a workaround in this Github thread answer. Setting or adding accessibility option to "on" worked for me.
"editor.accessibilitySupport": "on"
Try checking your configuration file.
Windows: %APPDATA%\Code\User\settings.json
Mac: $HOME/Library/Application Support/Code/User/settings.json
Linux: $HOME/.config/Code/User/settings.json
And remove the parameter "editor.wordWrap": "on" or change it to "editor.wordWrap": "off".
There is a fringe case where explicit word-wrap: off doesn't work. All you have to do to fix it is this:
Alt + z / Option + z
Do this in the editor that is wrapping lines.
More info:
This occurs most commonly when you paste a long line from one file to another.
Pressing Alt + z will force the viewport to update the horizontal virtualization (or lack thereof). You can read more about this bug-that's-not-a-bug here: https://github.com/microsoft/vscode/issues/21124#issuecomment-308644030
Related
Does anyone use Vim with VSCode?
For some reason, my <leader> key (space), does not activate the easy-motion plugin (I made sure it is enabled in the settings), but just moves the cursor to the right once.
I am new to VS Code, am I missing something? I still haven't figured out how .vimrc works with VS Code.
TIA!
It's not nessesary to use .vimrc file for vscode unless you want some customized behaviors.
Make sure you've enbaled the easymotion in vsvim settings:
"vim.easymotion": true
(in your settings.json file)
When it comes to VSCode, easymotion will be triggered by double press <leader> key. Different from Terminal Vim, for example: (in your case <leader> is set to space)
space + space + 2 + s
after you press the above keys, your status bar should look like
this.
Hope it would help you get into Visual Studio Code quickly.
As far as I know, vim mode in VS code isn't configured by .vimrc file, instead, it's configured by setting.json. You can find how to configure them in this README.md.
Check that:
"vim.leader"is set to <Space>
go to preference -> Keyboard shortcut in VS code. Make sure that you did not customize any command to any shortcut starting with <space>. (I made this mistake before)
the timeout length of the leader key is pretty short, make sure you press, let's say, 'w' key right after <leader><leader>
I hope this would help
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.
Recently switched from Sublime Text 3 to VS Code. Overall pleased with the switch except for this one little thing that's just annoying enough to be a dealbreaker if there's no solution. In ST3 if I type, say, a <div>, it doesn't automatically drop in a </div>, which is nice because I'm often pasting it in and don't want it closed right there.
What ST3 DOES do, however, is complete the tag the moment I type </. It autofills div> the moment I type the forward slash. This is the behavior I want from VS Code. I can't find any mention of this anywhere which is completely baffling. I know how to autoclose tags, but that's no good becasue then I have to manually close them. I want VS Code, like ST3, to autocomplete the tag for me, just not immediately.
Go to File > Preferences > Settings, search for html.autoClosingTags and set it to false.
This will make it so when you type <div>, it won't insert </div> automatically, but if you start typing </, it won't close the tag automatically. You can press ENTER to make it autocomplete for you.
Or you can leave this option enabled and when you type <div> and it autocompletes, you can just press CTRL + Z.
More information on this behavior here.
Add this to settings.json to make it work like Sublime Text:
"html.autoClosingTags": false,
"auto-close-tag.SublimeText3Mode": true
Go to Settings, search for "auto closing" and enable/disable these options as needed
Or set them in your settings.json file like so:
"html.autoClosingTags": false,
"typescript.autoClosingTags": false,
"javascript.autoClosingTags": false,
On Windows/Linux - Ctrl + Shift + P
On MacOS - Cmd + Shift + P
In the search box type settings.json
paste the following line there
"html.autoClosingTags": false
A very simple trick i learnt
If you want to disable tags auto completion for just a single task for example. To save a file without vscode adding closing tags. Just set a different language mode for that file.
Change from the inferred one i.e html to Batch, Diff ignore. The options on vscode are many. This will enable you to save the file without addition of any closing tags.
After you are remember to reset the language mode to Auto Detect.
TLDR;
To access language mode-:
Use the command pallete and search Change Language Mode or
Find a shortcut at the bottom right section on Vscode.
I have the following settings in VS code to disable word wrap
"editor.wordWrap": "off",
"editor.wordWrapColumn": -1
Word wrap is still not turned off. This makes VS Code really unfriendly to use on my laptop with a small screen.
Is there some additional setting I can use?
I am on 1.17.1.
Are you using markdown? vscode changes some default settings:
"[markdown]": {
"editor.wordWrap": "off"
}
On version 1.17.1 try changing default settings (not overriding with user settings) to:
"editor.wordWrap": "off",
"editor.wordWrapColumn": 80,
That works for me. And you can also edit the user settings (via Code or directly editing settings.json file on AppData\Roaming\Code\User (at my computer) by just adding the wordWrap line.
After changing settings always close and reopen both VS Code and the file (as it saves it opened).
If you are dealing with a file that has very long lines, this could be the issue you are facing.
https://github.com/microsoft/vscode/issues/21124
It seems it is made that way by design to prevent slow load times. It can be manually overridden with ALT + Z shortcut while the file is opened. After that, it reverts to the old setting and you have to do it again.
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.