Can't print } on Visual Studio 2017 on Italian keyboard [duplicate] - visual-studio

This question already has an answer here:
Recent Visual Studio update introduced shortcut used to create closing curly brace on my keyboard: how to find offending command?
(1 answer)
Closed 4 years ago.
When I press the keyboard shortcut CTRL+ALT+SHIFT+] on an Italian keyboard to add a closed curly brace, Visual Studio selects a block of my code instead of printing it.
I have already tried to reset the keyboard mapping on Visual Studio but to no avail.
Other programs works without problems. How can I fix this problem?

It is a new feature appeared in Visual Studio 2017 version 15.8.0.
It is called ExpandSelectionToContainingBlock and it is mapped to the keyboard shortcut CTRL+ALT+SHIFT+] or CTRL+ALT+SHIFT++ (For VS in Italian)
But this mapping has removed the ability, from some keyboards without the key for the closing brace (like the Italian one), to press those keys and get the, indispensable for many programming languages, close curly brace.
As far as I know there are two workarounds
Go to Tools menu and select Customize
Press the Keyboard button
Search for Edit.ExpandSelectionToContainingBlock
Press Remove
or just use the numeric keypad and press
ALT+0125
For Italian readers with the Italian version of VS, the search above at point 3 should be for Modifica.Espandiselezioneabloccocontenitore. I don't know if other languages are affected by this 'translation vice' but it is a thing to be aware of.
The problem has already been reported to MS (Thanks Albireo)
EDIT: It seems that they have fixed the problem, in version 18.5.2 there is anything assigned to the shortcut. But I am not sure if this is an effect of my previous action or if this (no shortcut) is the real default now.

Related

Visual Studio: Tab key selects and highlights code [duplicate]

This question already has answers here:
Hitting Tab in Visual Studio selects block instead of adding indentation
(3 answers)
Closed 6 years ago.
If I place my cursor inside a multi-line comment:
/*
* place cursor after the asterisk and before the word 'place'
*/
if (x == 0)
{
// some code
}
... and hit tab, Visual Studio doesn't add whitespace as usual. Instead, it highlights the entire comment (all three lines, in the example). If I hit tab again, it will select and highlight the next statement or block of statements. In my example, it highlights the entire if.
How do I fix this and make Visual Studio tab things over? I want tab to behave like a tab.
I'm using Visual Studio 2013 Ultimate with Resharper 9. It started doing this yesterday, and I have no idea why.
Figured it out. It wasn't in VS' settings! Somehow Resharper's configuration was changed. In Resharper's settings:
Environment > Editor > Editor Behavior
Uncheck the box labeled "Structural Navigation". Click "Save".

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 - keyboard shortcut to move caret/cursor to start or end of selection

Years ago I read about a visual studio shortcut which, if you had a selection, would move the caret/cursor to the start or the end of the selection.
I've tried searching for it, but can't for the life of me find it again.
In the image below, the text is selected and the caret is at the end, (highlighted pink). This shortcut would move the caret to the start of the selection (highlighted yellow).
Does anyone know what this shortcut is?
I'm pretty sure that this the command called Edit.SwapAnchor. The documentation says that this command:
Swaps the anchor and end points of the current selection.
The keyboard shortcut probably depends on your IDE configuration (i.e., which language you indicated that you primarily develop in on first launch), but in mine it is mapped to Ctrl+R, Ctrl+P. That's the default for C++ developers, matching the default shortcuts for VC++ 6.
Edit:
Indeed, this is the one you're looking for. According to this post on the VS Tips & Tricks Blog, the keyboard shortcut is Ctrl+K, Ctrl+A.
And back in VC++ 2 it was mapped to Ctrl+Shift+X. :-)
I'd open up Tools -> Options -> Environment -> Keyboard, type in "swapanchor" in the search box, and see what it's mapped to in your environment. If you use it frequently, change it to something memorable.

VS 2010: How do I get "next tab", "prev tab" keyboard shortcut working? [duplicate]

This question already has answers here:
Changing Ctrl + Tab behavior for moving between documents in Visual Studio
(14 answers)
Closed 9 years ago.
How do I get "next tab", "prev tab" keyboard shortcuts to work in Visual Studios 2010?
(For a more precise description of the functionality I need please see the firefox/chrome/etc and how they do their "ctrl-pgdn" and "ctrl-pgup" keyboard shortcuts).
This should be extrememly easy... and yet I can't seem to figure it out.
NOTE:
I do know that there is a "ctrl-tab" that is similar... but it only scrolls through the "most recently used list" which is different. I don't care about "the most recently used list". I just want to go to the right/left tab.
You should map the Window.NextDocumentWellTab and not View.NextTab and remove it from any other functions its assigned to. Only mapping it will not work, you also need to unmap from anything else its being used on, apparently.
This is what my keyboard configuration looks like:
Looked into this some more, and it turns you need to install the Productivity Tools. That gives you that NextDocumentWellTab function.
Under Visual Studio 2010 Professional, this keyboard shortcut goes by the name Window.PreviousDocumentWindow and Window.NextDocumentWindow.
Important Note: By default, Ctrl-PgUp and Ctrl-PgDown are assigned to Edit.ViewTop and Edit.ViewBottom respectively, so make sure to remove the existing keyboard assignment before trying out your new assignment. If you don't, the keyboard commands you enter will continue to be interpreted as the most "specific" shortcut (Edit.ViewTop or Edit.ViewBottom) since you're most likely trying this out in the Edit view!

Visual Studio 2010 shortcut to go back from definition [duplicate]

This question already has answers here:
After "Go to Definition", is there a command to return to where you came from?
(9 answers)
Closed 9 years ago.
In Visual Studio when going to definition by pressing F12, it takes you to definition. Is there any way to go back to where you came from?
This is specially annoying when you have definition within same file. If it's in another file then it's ok Ctrl+Tab take you back to previous window. But when it's in same file then have to find where you came from and go there.
Try the key combination: Ctrl + -.
As others mention, use Ctrl + -. This is the View-NavigateBackward shortcut in Visual Studio's default key mapping scheme, and can be mapped to any key combination you like from Tools->Options->Keyboard. I like Alt+← myself, to match typical web browser use.
Note that, for most five-button mice, the navigate-left button will also do this.
Ctrl + -
Ctrl -> '+' -> '-'
I searched for a long time till i found that one, and I can't stop using it since!! :)

Resources