Microsoft Visual Studio Hotkey waiting for another keypress - visual-studio

I'm used to Netbeans and all its shortcuts (e.g. ctrl+e to delete a line), but I'm new to Visual Studio, so I don't like its keypress combinations that much.
When I changed all the hotkeys I need (e.g. alt+shift+up/down to move lines up and down), I also tried to set deleting a line to ctrl+e.
The problem is that when I press ctrl+e now, the IDE waits for me to press another key, because there are hotkeys that go like "ctrl+e followed by ctrl+something".
Do I have to disable all the other hotkeys if I just want to use ctrl+e, or can I tell the IDE something like "when nothing is pressed after ctrl+e for 500ms, then dont wait any longer"?
Thanks in advance.
PS: Microsoft Visual Studio Enterprise 2015

These multi-sequence keystrokes are called chords, and Visual Studio uses them because it has so many commands that there would otherwise be nowhere near enough keyboard shortcuts to invoke them all. And no, you cannot set a timeout value.
You have to disable all of the other keyboard shortcuts that involve Ctrl+E, otherwise the software will have no way of knowing if it should keep waiting for you to press the second part of the chord.
Here's a hint that may make your life easier. When you arrive at the Environment → Keyboard options, don't bother to select anything. Just leave everything at their defaults and click in the "Press shortcut keys" box. Type Ctrl+E. Now, the dialog will give you a list of all the currently-mapped shortcuts that use Ctrl+E.
On my installation, all but one of them are specific to the "Workflow Designer". Only one is used by the "Text Editor"—Edit.ToggleWordWrap, which is mapped to Ctrl+E, Ctrl+W. Since you will only be deleting lines in the text editor, you don't actually need to worry about unmapping all of the shortcuts for the Workflow Designer scope. You can just set up your shortcut as being specific to the text editor. Stepwise:
Remove the keyboard shortcut for Edit.ToggleWordWrap. (You can do this quickly by typing "toggleword" into the "Show command containing" textbox.) Click the "Remove" button.
Now, switch to Edit.LineDelete.
Change the "Use new shortcut in" combobox to "Text Editor".
Click in the "Press shortcut keys" box, and type a good old chordless Ctrl+E.
Click "Assign", and you're done (unless you want to change ToggleWordWrap to something else).

Related

VS 2017 (Ctrl+R) was pressed. Waiting for second key of chord

In Visual Studio 2015, Ctrl+R was globally mapped to Edit.NavigateTo. In VS 2017 Community, they've renamed this to Edit.GoToAll, which Ctrl+R is globally mapped to. But when I press Ctrl+R in C# editor, I get "(Ctrl+R) was pressed. Waiting for second key of chord..." and the dialog does not open.
What is hijacking Ctrl+R and how do I prevent it?
Aah, didn't notice that shortcuts in use was a dropdown with multiple values - thank you Hans Passant. Looks like Edit.ViewWhiteSpace defaults to Ctrl+R, Ctrl+W and that was making Ctrl+R not work at all. Odd.
I had a massive problem with chords where I couldn't even use "command Z" anymore. The way I was able to fix my chords issue was by editing the JSON file by following:
settings
preferences
keyboard shortcuts
while in keyboard shortcuts on the top right you will see an icon that looks like a file with an arrow on it. Click this. It will take you into keybindings.json.
Here you can view all chords, add, edit and delete chords. I removed my command z chord and everything was back to normal.

How do I select proper action in the dialog "Resharper - Shortcut Conflict" for a shortcut?

When I press ctrl+R, ctr+R, a dialog comes up
Lets assume that I want to map the shortcut to "Refactor.Rename".
When I clicked OK here, the action was not mapped to the shortcut.
Instead the shortcut became disabled as in not being "available".
Resetting all shortcuts to visual studio defaults and doing this again actually gave me the resharper action upon pressing Ctrl+R, Ctrl+R.
Does it matter when I select in this list before I press OK?
If I select something in the list and also make a radio button selection, what will be the result?
Is there any way for me to use this dialog to select an action without resetting all shortcuts to either visual studio defaults or resharper defaults?
List selection doesn't matter and only radio button selection makes sence. There is no reference to list selection in documentation.
The "shortcut became disabled as in not being "available"" message is displayed even if your code window lost its focus. Are you sure the shortcut really was broken?

Waiting for second key of chord

I have assigned the keyboard shortcut Ctrl+E to a command. But when I click Ctrl+E, the status bar says Ctrl+E was pressed. Waiting for the second key of the chord...".
If I hit the Esc key, I get "The key combination (Ctrl+E, Esc) is not a command."
How do I activate the command that has been assigned to Ctrl+E?
I know that this is the same as the question How do you stop Visual Studio from waiting for the second part of a shortcut-combination? . But the answer given there (hit Esc) does not work for me.
The selected answer is wrong in stating you cannot use Ctrl+E by itself (at least for Visual Studio 2013).
For those who come from a Mac or other OS background where Ctrl+E takes you to the end of the current line (the End key shortcut by default in VS), this is a really frustrating limitation when switching environments.
I found that in Visual Studio 2013 at least, you can remove all the shortcuts that use the Ctrl+E chord (none of which I will ever use) and set the Edit.LineEnd command to Ctrl+E. It just takes a few minutes tracking down the chords to remove (most of them are under the workspace designer).
To see which commands are using your keyboard shortcut at the moment, enter it
in the "Press shortcut keys:" edit box. Make sure you don't accidentally click "Assign".
In the dropdown box "Shortcut currently used by:" you can browse
through and manually remove all commands that
currently occupy your desired shortcut combination.
Key chords are a keyboard shortcut feature of Visual Studio. They consist of a sequence of key presses like (Ctrl+K, Ctrl+C) for comment code or (Ctrl+K, Ctrl+U) for uncomment code.
They are activated by the user pressing one Ctrl+key combination, then another Ctrl+key combo. For example Ctrl+K, Ctrl+C on my install of Visual Studio is used for commenting selected text.
In your case, Ctrl+E is a common chord starter and is used by many chords. For example Ctrl+E, Ctrl+W = Toggle Word Wrap and Ctrl+E, Ctrl+X = Workspace Designer.ExpandAll.
Depending on which developer setting you've chosen for the IDE, Visual Studio might have Ctrl+E mapped to other chords. In that situation, you cannot use Ctrl+E by itself for a keyboard shortcut
If this is the case, you can create your own chord, Ctrl+E, Ctrl+D is not in use on my install of Visual Studio 2012.
Edit:
Also if you remove all key chords that start with (Ctrl+E) then it can work as a non-chord shortcut.
And your question is not the same as the other question. In that question, the OP has started the chord process (Ctrl+E) and wants to cancel Visual Studio from waiting for the 2nd chord key.
I came to this question because I had the same problem as the OP, but in the Integrated Terminal of Visual Studio Code (not Visual Studio).
My problem:
I couldn't stop the node server by doing Ctrl+C, because my VS Code was waiting for the "second key of chord"...
I fixed it in the user settings, by unchecking the Allow Chords checkbox.
I answered the more suitable question for me here.
I have had the same issue with my "<" [backquote] key and wasn't able to find the right keybinding in the normal settings. Allow chords wouldn't do anything either.
This is for anyone, who isn't able to reasign the key in the default keybindings:
Find the User settings in your terminal.
Windows %APPDATA%\Code\User\
macOS $HOME/Library/Application Support/Code/User/
Linux $HOME/.config/Code/User/
Open the keybindings.json file
look for all chords that you would like gone.
(Obviously) remove/alter them
I hope I could help some of you!
You can disable it only for the integrated VSCode terminal by adding the following to your setttings.json file:
{
...
// Disable chords for terminal usage
"terminal.integrated.allowChords": false
...
}
Go to Tools -> Options.
A window will open up, In that Environment -> Keyboard -> Keyboard
And Just Press the Reset button on the right.
Screenshot
Do
ctrl+ E
then
ctrl + V
More info here:

Visual Studio 2010 keyboard shortcut for next reference in C++

In VS2010 (C++) when I use Shift-F12 to invoke Edit.FindAllReferences(), I expect the F8 key to jump my cursor to the next found reference. It did on my old machine, but I just got a new one and now it does not.
Is there a different keyboard shortcut, or better yet, what is the command to jump the cursor to the next Find Symbol Results item?
(Yes, I tried Google... best I could find is F8 for when you invoke a Find All, and in the case of Find All, it does work, but I want "Find All References". I wouldn't have expected a difference...)
Thanks,
Karl
The F8 works on mine. Did you check your keyboard mappings. The default keyboard may have been setup differently (at install, there are choices like VC++2, VC++6, etc...)
Open Tools/Options Menu
Choose environment/keyboard on the left
On the Options dialog, find the "Press shortcut keys:" text box. Put your cursor in that box and press the F8 key.
Just below it in the Shortcut currently used by: "Edit.GoToNextLocation(F8 (Global)).
If it doesn't say that, you may want to change your default keyboard mapping scheme.

Visual Studio Window Shortcut Wonkyness

I've been diligently memorizing VS 2010 shortcuts based on the cheatsheats on Scott Guthries blog.
The shortcuts in the cheatsheet for WIndows dont match my setup e.g. Ctrl W,C is the cheatsheet shortcut to open the class viewer but mine is Ctrl + SHift, C. Maybe this is because my 08 settings got picked up at some point.
I've changed the shortcuts for viewing windows to match the cheat sheet (Ctrl + W,...) however most of the time Ctrl+W,... isn't working for me, whereas the previously defined shortcuts still work. If I go into the keyboard mappings I can see the shortcuts under global are Ctrl+W.
Anyone got any ideas?
Try going to Tools -> Options -> General -> Keyboard, focus the textbox labelled "Press shortcut keys" and pressing Ctrl+W. The dropdown list beneath it will show all corresponding actions. Action mappings are contextual -- they depend on what has the focus. Furthermore, 'Global' actions only apply if a more localised mapping does not exist. Check for anything applied to 'Text Editor'. If it exists and you don't want it, remove it by digging the action out in the 'Show commands containing' textbox above and clicking 'Remove'.
Also, do you have ReSharper installed? I love R#, but it uses Ctrl+W so the series of shortcuts you're referring to aren't available without being remapped or changing the R# keystroke (which I wouldn't personally, as I use it all the time.)

Resources