Shortcut key to Toggle Results Pane SQL Editor Visual Studio 2012 - visual-studio

In Visual Studio 2012, I'm trying to use Ctrl+R and it is not hiding results pane in SQL Editor window.

Ctrl+D, R.
Do notice that it is NOT Ctrl+D, Ctrl+R, i.e. you will have to lift your finger from Ctrl key when you press R

Go to Tools > Options > Environment > Keyboard / General.

Related

CTRL+D doesn't work in Visual Studio 2022

CTRL+D (duplicates) It doesn't work in visual studio 2022 , How to change Ctrl+E,V To CTRL+D ?
I just had the same problem.
The issue for me was that Visual Studio 2022 had set the mapping scheme to Visual C# 2005 instead of (Default).
In the search bar at the top of Visual Studio 2022 (Ctrl+Q), search for key bindings, or go to Options->Environment->Keyboard.
Make sure the keyboard mapping scheme is (Default).
I hope it helps.
Duplicate line is implemented via Ctrl+E,V as explained here.
This operation does leave the clipboard untouched.
Command and respective keys are shown in the Edit Menu.
Go to TOOLS -> Options -> Environment -> Keyboard and then on 'Show commands containing:' search Edit.Duplicate and on 'Press shortcut keys:' press Ctrl+D and click on 'Assign' button.

Ctrl+Shift+Right arrow doesn't work in Visual Studio 2019

I can't select words to the right by using the standard shortcut Ctrl+Shift+Right arrow.
By the way, words selection to the left with Ctrl+Shift+Left arrow works well.
Probably, the ReSharper keyboard layout creates this trouble.
I fixed this in Visual Studio 2019 in the Tools > Options window.
Select Environment > Keyboard and paste Edit.WordNextExtend into the "Show commands containing" field.
Then proceed as shown by the red arrows in the following image.

Ctrl+K was pressed. Waiting for second key of chord

I'm using Visual Studio 2013 Ultimate and when I select a code to be comment I press Ctrl+K but it show me this once I pressed Ctrl+K was pressed. Waiting for second key of chord... any idea how to fix it?
There is a command Ctrl K+C to comment any line, and Ctrl K+U to uncomment.
You can see what the keyboard binding is under Edit > Advanced > Comment Selection (2010):
And 2013:
Additionally, you find keyboard bindings under Tools > Options > Environment > Keyboard. Here if you search for "Comment", you can find the Edit.CommentSelection (and Edit.UncommentSelection) which you can assign whichever shortcut you prefer.
You can look after and manage your shortcuts in Tools / Options, Environment / Keyboard.
You should see a dropdown menu where all shortcuts are listed.
There you can change your existing shortcuts or reset them to the default.
The default shortcut for me (Visual Studio 2015 Community Edition) to comment was Ctrl K + C and to uncomment Ctrl K + U.

What's the equivalent for eclipse's ALT+UP/DOWN (move line) in Visual Studio?

In Eclipse, selecting a line and pressing Alt + ↑/↓ will move the line up and down, a quick way to avoid copy&paste.
Is there an equivalent in Visual Studio?
In Visual Studio 2013 and later, this functionality is built in. ALT + UP/DOWN will move a line up or down.
If you need this functionality in VS2012 (works with VS2010 too), take a look at the MoveLine Visual Studio Extension or the Productivity Power Tools suite.
ReSharper's Ctrl + Shift + Alt + ↑/↓/←/→ is even more powerful - when on the beginning of the line, it will move the entire line, but can also be used to move entire methods, change the order of parameters, etc.
For me in Visual Studio 2019 it comes default closed.
For open it:
Tools -> Options -> Keyboard then select Edit.MoveSelectedLinesUp, click "Press shortcut keys" input and press Alt + Up (or whatever you want for it). And the other one is Edit.MoveSelectedLinesDown, click "Press shortcut keys" input and press Alt + Down (or whatever you want for it).
This is now working out of the box with Visual Studio 2013, same way as in Eclipse.
For Visual Studio 2013:
Tools -> Options -> Keyboard then select Edit.MoveSelectedLinesDown, click "Press shortcut keys" input and press Alt + Down. You also have to select the scope of the shortcut to be within "Text Editor".
In Visual Studio 2013 and later, you can move lines up and down using Alt + ↑ / Alt + ↓. Unfortunately this will not adjust the indentation if you move between blocks, as of today only ReSharper (and all other IDE's by Jetbrains including Rider) can help you with that.
To move entire blocks of code around you can move the cursor to its head and press Ctrl + m twice fast to collapse it, and then use the command above to move it around.
Here is a neat reference to all default keyboard shortcuts in different versions of Visual Studio.
With the VSCommands extension, you have exactly that keyboard shortcut. And, by the way, a Stack OVerflow notification toolbar :)

Shortcut for "Find Result 1" in Visual Studio?

Shortcut for "Find Result 1" in Visual Studio?
Hotkeys for Visual Studio 2010 - Alt + vn1
Hotkeys for Visual Studio 2015 - Alt + vnnEnter1
Hotkeys for Visual Studio 2017 - Alt + vnnnEnter1
If you don't feel like customizing your own shortcuts, or you use different environments where you can't always rely on your customization being present, you can always go the old school route of just navigating the menus via hotkeys.
For instance, in Visual Studio 2010, you can just type Alt + vn1.
Typing Alt + v opens up the "View" menu.
Typing n opens up the "Find Results" menu item in the View menu.
Typing 1 selects the "Find Results 1" menu item, thereby opening and setting focus to the "Find Results 1" window.
Likewise, Alt + vn2 opens up the "Find Results 2" window.
If you do this enough, it's like any other keyboard shortcut, and becomes second nature.
ProTip
You can discover the hotkey shortcut to any menu item you need by just hitting Alt, and looking at the letters that are underlined in the menus. This applies to pretty much any windows program you will ever use.
There's no predefined shortcut for that (at least in VS 2005) but just select Customize... from the Options menu, press the Keyboard... button and then create a suitable shortcut for View.FindResults1.
In Visual Studio Professional 2013 (not sure about the other version) the function key "F8" will take you to the next result in the Find Results window, and "Shift-F8" will take you in the reverse direction (i.e. find previous result).
You can assign keyboard shortcuts as you please through Tools > Customize > keyboard.
In the show commands containing textbox type View.FindResults1.
In the Press shortcut keys textbox type in the shortcuts you want to add and then press the Assign button.

Resources