Shortcuts within Find/Replace dialog do not work in Visual Studio Code? - visual-studio-code

As shown in this screenshot there are 5 occurrences of the "Find" field. But hitting CMD-ENTER -as shown in the shortcut balloon help - does nothing.
Why is it not working/ what can be done to get it to to work? I detest using the mouse for extremely common operations especially Find/Replace.

It is a little odd that the binding is Cmd+Enter on the Mac, whereas it is Ctrl+Alt+Enter on Windows? Things to try:
The equivalent of Ctrl+Alt+Enter on the Mac (and you indicated that Cmd+Option+Enter does work).
Check in the Gear Icon/KeyboardShortcuts editor what the command editor.actions.replaceAll is bound to.
Check in the Keyboard Shortcuts (click on the little keyboard icon to the right and type Cmd+Enter) to see if it is bound to something besides editor.actions.replaceAll.
You can run the Developer: Toggle Keyboard Shortcuts Troubleshooting command from the Command Palette, type Cmd+Enter and see what command vscode finds for that keybinding.
You indicated that Cmd+Option+Enter does work as you expect.

Related

Ctrl+. (Dot) makes "e" appear instead of showing suggestions in VSCode on Gnome

I'm using VSCode on Gnome (on XOrg on Arch). Since lately, the shortcut Ctrl+. stopped working, despite still being listed in the keyboard shortcuts and despite all extensions being disabled. Instead, an underlined e appears:
The character goes away when pressing enter twice or ESC once. When writing something and then pressing enter, the e goes away but the written text stays. When changing the window while the e is underlined, it becomes a regular e.
This seems to behave somewhat similarly to the compose key, which displays an underlined centered dot after being pressed.
I can't find any keyboard shortcuts for Ctrl+. in the Gnome settings.
What is this feature? What is it good for? And how can I restore the original behavior?
This is not related to VSCode, as the same thing happens in any text input field across all apps (both on Wayland and Xorg, Fedora).
The issue appeared on my pc when I upgraded to Gnome 42, and I still can't find a way to fix it (keyboard shortcuts don't have any entry for Ctrl+.).
Edit: Found this post about this issue. Their fix is to run ibus-setup and to disable the ibus shortcut.
This issue is not related to VSCode. I've experienced it too on my Linux Ubuntu 22.
Try this to turn off Emoji annotation keyboard shortcut:
$ gsettings set org.freedesktop.ibus.panel.emoji hotkey "[]"
Or run
$ ibus-setup
Under emoji tab, clear 'Emoji annotation'

How to get keyboard shortcut `Cmd + S` to save on VS Code?

When I attempt to save my file on Visual Studio Code with the cmd+s keyboard shortcut, it does not save the code. I have to manually click File, the Save, just to be able to save my progress. I'm using macOS Catalina version 10.15.7 and VC Code version 1.55.2.
How do I fix this?
Attempts:
-Checked if ⌘ Cmd + S keyboard shortcut is tied to the Save functionality
If you do it right this solution will fix your issue.
I have never had a problem saving with VS-Code personally, but I have had issues with keybindings. IDK if you write your own keybindings, but if you do, you might want to check the keybindings that you have wrote to make sure they do not conflict with [CTRL + S]. The keybindings.json file that you create custom keybindings in, overrides the default keybindings.json file that defines the keybindings that VS-Code ships with.
To check your keybindings.json file...
Hit the F1-Key
A menu will drop open type in "Keyboard Shortcuts"
There will be two Preferences: Keyboard Shortcuts
Make sure to select Preferences: Keyboard Shortcuts and not Preferences: Default Keyboard Shortcuts
If the file is empty you are good. If you have keybindings written in the file, you need to iterate through them by hand, checking each one. Make sure that none use [CTRL + S] together. Even if the keybinding uses [CTRL + S] and other keys, you will need to disable it, so you can test if it is causing an issue.
Debugging [CTRL + S]
If your keybindings.json file is all good, then great, that's one thing to scratch off the list. The only thing left to do now is debug the Bound Key ("Key Binding"). To debug keybindings, you will use a built in tool, that VS-Code offers. To start do the following:
Hit the F1-Key
When the quick input drops open type the following into the text input:
"Toggle Keyboard Shortcuts Troubleshooting"
Select the option: Developer: Toggle Keyboard Shortcuts Troubleshooting
It should automatically open the OUTPUT panel, which is located in the same panel that your terminal is. Make sure that the OUTPUT is set to LOG(Window) in the drop down. (I took a picture and posted it below if you can't find the Keyboard Shortcut Troubleshooter).
The image might have funny declensions because I am on a dual monitor setup with 1 1080x1920 curved screen and one 1080x720 screen.... I cropped it to a STD HD 1920 width.
I Got My Trouble-shooter working, and Output open, now What Jay?
Okay... Well your at the right spot. Now every-time you press some keys, you should see your OUTPUT WINDOW working like crazy. It should be logging all sorts of stuff, which is good, very good.
This Part Is Important! READ CAREFULLY
What you want to do is use your keybinding that you feel isn't working appropriately. Use it when focus is set on an editor, use it when focus is set on a different editor, use it when focus is set on the sidebar. Where you are focused at in the editor at any given time can greatly affect a keybinding. The output is gonna write lines every-time you use your keybinding. Try not to hit any other keys while doing this, so you have a column in you output that includes logging from the keybinding you are testing only. Read the output see what it says. See if it looks right, or wrong. If it looks wrong, you can visit this link, to the VSCode site that covers this topic, and see if you can fix it your self. If you can't fix it your self, come back here, and edit your question. When you edit your question make sure that it includes the Troubleshooter's Logging Output.
VSCode Troubleshooting Keybindings (Keyboard Shortcuts) # https://code.visualstudio.com/docs/getstarted/keybindings#_troubleshooting-keybindings
Image that shows how to open the Keyboard Debugger
Also shows how to set the OUTPUT to Log(Window)
StackOverflow-2021-JUNE-26018:34-PST
Another thing to check for is, for lack of a better term, combination key bindings. For example, I was having an issue with ⌘+s. VSCode gave a message that it was waiting for the second key binding. After looking at the keybindings.json, I noticed I had a key binding for opening up user snippets as
{
"key": "cmd+s cmd+n",
"command": "workbench.action.openSnippets"
}
The ⌘+s portion of this key binding conflicted with the default ⌘+s

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.

In Visual Code editor, how can I which functions a key is bound to?

In Visual Studio Code editor (not Visual Studio to which this answer and this answer applies) how can I know which function is bound to a particular keyboard shortcut?
I know about assigning a keyboard shortcut to a function and then using the conflict resolution option that the editor provides to resolve any overloaded keystrokes. What I want to know is how to find which function is assigned to a particular keystroke. Apparently, in Visual Studio (IDE) there's an option to use a "Shortcut currently used by" dialog so that you could type in a keystroke/chord and it would show the function (rather than execute it) (see links above). Emacs has the same type of thing where you can type a keystroke and see what it is bound to.
The backstory on this: I used to open the recent files list via ctrl+R. Recently it says "Waiting for second key of chord...". I can see that the recent files function is STILL bound to ctrl+R but short of eyeball browsing hundreds of commands I can't determine how to backtrack to find whatever is using the ctrl+R key chord.
Open your keyboard shortcuts preferences (⌘K ⌘S). The search input field has a keyboard icon on the right side. Click that - or press ⌥⌘K - to record keys and VS Code will show you all commands for that specific keybinding.

Ctrl+Backspace/Option+Delete fails to delete previous word in MATLAB IDE

I've noticed that Ctrl+Backspace/Option+Delete doesn't delete the word to the left of cursor in the MATLAB editor, as it does in many (most?) other editors and programs. This is intensely annoying, as I often will want to change a function name or small section of code. Currently I am forced to hold shift, use option+left, and then press delete to perform what should be a two keystroke operation.
Is there a way to enable it, or is a similar shortcut available? I found this unanswered question on MATLAB Central, but no further joy.
Edit:
Running R2010a on OSX
Are you on R2010b?
At least on Windows, this is supported starting in R2010b. All the keyboard shortcuts are in File > Preferences, under Keyboard > Shortcuts. Type "word" in the search bar (the text field just above the list of actions) to see the word-level actions. In R2010b, but not earlier versions, there is a "Remove Previous Word" action, and in Windows it's bound by default to Ctrl+Backspace. Sounds like you're using Mac, too; I don't know what the default binding is there.
So, upgrade to R2010b, and maybe adjust the bindings under Keyboard > Shortcuts in Preferences.
This and some other keyboard shortcuts work in the editor but not in the command window. I don't know why. You might want to request that as an enhancement from MathWorks if you want it in the command window, too.