Why vscode shortcuts don't work properly? - visual-studio-code

I've recently updated my VSCode and most of its shortcuts don't work anymore. I tried to reinstall my VSCode but it didn't work. I've checked if it's affected by any other system shortcuts but I wasn't lucky enough and none of them worked for me.
Some shortcuts like:
ctrl + d,
ctrl + shift + k,
etc.

I found a solution for this problem.
go to : File>Preferences>Keyboard Shortcut
Then from upright of the page select the icon that says open keyboard shortcuts. Like below
In the keybindings.json tab you may see something like this:
Replace everything with the settings from the following links:
if you are using windows copy settings from this link: windows.keybindings.json
for mac: macos.keybindings.json
for linux: linux.keybindings.json
and if you want to see all available options see this link: vs-code-default-keybindings
after saving the file, your vscode shortcuts will work properly again.

There could be many reasons. First check that if there is any other application overrides the shortcuts or not.

If there are multiple VS windows, some binded keys are did not work. In my case, everything worked when I closed the windows. Except a one window.

Related

Disable specific keybinding in vscode

I ran into a problem with my keyboard lately, my - and = stopped working and I manually remapped the two keys to PgUp and PgDn by editing /usr/share/X11/xkb/keycodes/evdev. Everything works fine but the problem is that vscode still recognizes these two keys as Page-Up and Page-Down while other editors respect my new config. The question is "How do I make vscode adapt to my new configuration"?.
Thanks in advance
I have been able to solve this problem by deleting all the keyboard shortcuts associated with the remapped keys. All I did was opened,
File > Preferences > Keyboard Shortcuts, searched for the word PageUp, right-clicked the matching words and deleted them all. I did same for PageDown and everything works fine now.

How to search ('Ctrl+F') in 'output' panel in VS Code?

I used to be able to be able to Ctrl+F to search whatever was logged in VS Code. Now, for some unknown reason, the search bar doesn't show up when I type in Ctrl+F.
I am on version 1.57, which is the latest at this time.
This question if for the Debug Console which isn't the tab I am looking at.
Click anywhere inside the output panel, and then press Ctrl + F
I realized that the Vim extension is what is causing this. Ctrl+F is for scrolling and although previously Vim keyboard shortcuts didn't work in the output panel, they seem to have been extended to it recently see this issue I raised.

VSCode Command Palette (Ctrl + Shift + P) keyboard shortcut isn't working on new installation

When I press Ctrl + Shift + P in VSCode (shortcut for "Command Palette") nothing happens.
Side note: I've just installed VSCode on my new PC (Windows 10,) so it's a fresh installation if that helps (it works on my laptop.) This is unsettling since I can actually see Ctrl + Shift + P listed in the bindings table.
It's important! Since for the most part I use this command to habitually open files.
Now I understand it can be possibly caused by some other software, perhaps -- I'm looking into that (will post what I find, if I ever get it to work.)
If I can't figure it out, I'm simply going to rewire it (at least for now) in key bindings but it's not really what I want to do.
Meanwhile, is there any classic cases that can jam Command Palette, specific to new installation?
This is an actual issue on GitHub There is a good chance it's caused by other software which may be something like:
Password keychains
Screen capture
OBS
(Check any similar software you might use I can almost guarantee that one of the other apps is intercepting it globally. You said it's a new installation, so you probably installed other apps.)
To see all shortcuts or rebind Ctrl + S, then K as per this edit keyboard shortcuts tutorial. Make sure Ctrl+Shift+P is on this list. Another issue that could cause this is your VSCode json settings file is read only or doesn't exist for some reason. A lot less likely, but still worth checking. Good luck with this.
Razer Cortex after the last update started to intercept Ctrl + Shift + P and other keybindings. I've turned it off and it helps, but you can try to change those keybindings in the Cortex settings if that's what causing the problem in your case.
it would be "ctrl + k + s" to see the command list, and yes F1 is the alternative to "Ctrl+shift+P" I also have Razer mouse and it seems to conflict.
For Mac Users
In Mac had the same problem and realized that it occures after triggering Git Lense extention. A quick inspection on key bindings and disabling the non-default binding there solved the problem.
For me, TickTick on the Mac had overtaken the Command+Shift+P. I disabled it in TickTick -> More -> Hotkeys and removing the global shortcut.
A more general way to remove conflicting shortcuts on MacOS:
choose Apple menu > System settings, then click Keyboard in the sidebar. (You may need to scroll down.)
Click Keyboard Shortcuts on the right. A warning icon appears next to conflicting keyboard shortcuts. Double-click the shortcut, then change it.

Is it possible to have autocomplete in a notebook in Google Colab?

By autocomplete I mean having something like Intellisense in VS Code by which I can see available functions or members in a particular library?
Yup. Press control space (or command space, on a Mac) and autocomplete suggestions will appear.
If you navigate to Settings... and then uncheck "Automatically trigger code completions":
...you'll then be able to use tab-to-complete like in a conventional Jupyter notebook. From the Keyboard Shortcuts page of the Colaboratory app:
I'm on a macbook pro, Option+ Esc performs autocomplete for me.
Ctrl+Space (works on Mac as well), but I have to run the cell once:
If you have only one language on your macbook then you can press Ctrl + space for Mac, as well as for Windows.
Works like magic, see the image below:
If you have more than one language you are switching between languages using Ctrl + space, you need to use option+esc
On Windows it work the same way as with Ctrl+Space if you press Tab. Not sure about Mac, however.
you can check for what keyboard shortcut works for you in the settings in the keyboard shortcuts inside of the tools tab.

Ubuntu Visual Studio Code Toggle Comment no respond

I encountered an issue with toggle comment in visual studio code on Ubuntu. Default hot key was "ctrl+/", it didn't respond when I click on a line of code or highlighted the line of code. I changed the hot key to "ctrl+l" under preference -> Keyboard Shortcuts and it didn't respond too.
I tried to google this but nobody seems to encounter this issue or posted this question.
Is there something else I need to enable to make this work?
In my case it was due to the fact that VS Code 'didn't know' the language the file was written in. I was editing a .cmake file and VS Code does not 'understand' CMake syntax when installed out-of-the-box.
Installing a 'CMake' extension enabling CMake syntax highlight also enabled the 'Toggle Line Comment' [Ctrl+/] shortcut to work.
(I'm guessing without the specified language VS Code simply does not know which symbol to use to comment out the lines - e.g. '//' or '#' or else).
This the issue because in ctrl + /
/ -> is numpad divide
or
/-> simple / the key not present in numpad
so if you try any of these combinations one will definitely work, if u want to work with numpad one only you can go to
File-> Preferences -> Keyboard shortcuts (there search for toggle line comment and give your own shortcut)
For me, in VSCode has a error with ctrl + } and ctrl + shift + } 'cause is inversly and no show correctly the keys to hit.
You must redirect to Keyboard Shortcuts - Visual Studio Code, and search the shortcut "Comment", and hit:
blockComment: Insert ctrl + } when you hit ctrl + shift + }.
commentLine: Insert ctrl + shift + } when you hit ctrl + }.
The Shortcuts show like this
I hope that help for you.
That how I solved it. Open File/Preferences/Keyboard Shortcuts or type ctrl+K ctrl+S VSCode preferences. Then click {} button in the top-right corner. In the last version on Sep 16, 2019, it looks like a file with the arrow. Now you see keybindings.json, at the bottom there is a button Define keybindings - click and type in the form there "Ctrl+/" It will show you all commands with your combination. I found and commented the one from Emmet
` {
"key": "ctrl+/",
"command": "editor.emmet.action.toggleComment",
"when": "editorTextFocus && !editorReadonly"
},`
There was a conflict.
I had the same problem and I didn' found the answer in the internet, but eventually I found it on my own.
My system is Linux Mint and my computer is a Thinkpad 440p with an brazilian Portuguese keyboard. This keyboard doesn't have a Right Control key, and then key usually associated with it is used for slash (/) and interrogation mark if pressed with shift. Mint has a good driver for it, mapping it to the correct symbol. I have never had issue with any other code editor or software.
However VSCode by default bypass this keymap done by the system and uses raw code com from keyboard hardware. This can be changed in setting, keyboard dispatch. I change it from "code" to "keymap" and then it worked like a charm.