Visual Studio Window Shortcut Wonkyness - visual-studio

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.)

Related

Microsoft Visual Studio Hotkey waiting for another keypress

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).

Keyboard Shortcuts Not Working in Visual Studio 2013's Find in Files dialog?

I usually access Visual Studio's Find in Files feature with Ctrl-Shift-F, type in what I'm after and press enter.
Everything is working, I can type what I want to find, Ctrl-A will select all text, arrow keys will navigate within the Find What text control only the enter key press does nothing. The dialog still has focus, just nothing happens.
The accelerator keys that are marked on the various buttons also do not do what I expect. Alt-P will open the Project menu, Alt-F the File menu, Alt-A nothing. When the Find in Files dialog is focussed I expect the Find Previous, Find Next or Find All actions to be performed.
The tab key also does not change focus from one control to another while in that dialog.
The escape key will kill the focus in that dialog and return focus back to the file that I have open in the text editor as expected.
I have tried using the Reset button under Tools -> Options -> Environment -> Keyboard to no avail.
I am using Visual Studio Ultimate 2013 Update 4 on Windows 7 x64.
If you're using Resharper, after applying R# keyboard scheme, it will add it's keyboard shortcuts. For example, it adds Alf+F shortcut in Text Editor scope.
Setting your keyboard shortcut in Global scope is not enough if same keyboard shortcut is set by R# for Text Editor.
To override R# shortcut in Global scope, make sure you delete R# shortcut setting in VS keyboard settings modal dialog.
Rarely, strange keyboard shortcut behavior could be also caused by non-US keyboard setting. If you are using non-English keyboard set in Windows Control Panel settings, try this solution:
Set keyboard layout to US
Reset keyboard shortcuts in VS under Tools -> Options -> Environment -> Keyboard
Assign your shortcuts (e.g. Alt-F)
Set keyboard to your local layout

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.

visual studio shell F# keyboard shortcuts

I've started using F# with the visual studio shell and I like the capability to be able to send lines to fsi by highlighting them, but the alt+Enter shortcut is really awkward and I would be much happier with this being on shift+Enter. (mainly since shift+ up/down arrow is select lines already)
Does anyone know how to change this? Thanks.
You can alter the keyboard mappings within Visual Studio. If you go to Tools -> Options -> Environment -> Keyboard, you'll see a window like the image below.
In order to check existing bindings, place the cursor in the "Press shortcut keys:" box and hit "Shft+Enter". You'll then see any potential conflicts in the drop-down box as shown.
In the example below, I'm searching through Global, which means shortcuts for anything in the application. You can switch it to be just the console or whatever you like.
Once you're happy with the shortcut you want to use, you need to select the command from the window containing all of the Action.* lines and then press Assign.
So I don't mean to be trite, but have you tried mapping the key?
So for F# Interactive I see Alt+Enter mapped to:
ClassViewContextMenus.ClassViewMultiselectProjectreferencesItems.Properties
Have your tried mapping Shift+Enter (or whatever) to that command?
Tools->Options->Environment->Keyboard
You should be able to get it all working from there.

Is there a shortcut key to switch between split panes in visual studio/management studio?

When I have a file open in visual studio/sql server management studio and have it split in to two panes, I'd like to be able to switch between the panes without having to reach for the mouse. Does anyone know if a shortcut key exists for this?
F6 is your friend.
I think you can assign this by going to Tools -> Options -> Keyboard and searching for SplitPane. You should be able to assign shortcut keys for the following values:
Window.NextSplitPane
Window.PreviousSplitPane
CTRL+F6 will cycle through your files and across panes.
In SSMS: right-click toolbars, customize. Under categories, select Window, then under Commands select "Next Split Pane". Drag to toolbar. Right-click and change name to "Next Split P&ane". You can now use alt-a to change split pane.
On Microsoft SQL Server Management Studio (SSMS) 2012, I figured out that it is the combination of Ctrl+Shift+UpArrow(or DownArrow). :-)
This was not easy for me for some reason. This method finally worked (similar to Steve Dignan's answer above but I don't have enough rep to comment yet).
In VS 2012, Tools, Options, Environment, Keyboard.
"Apply the following additional keyboard scheme" set to "Visual C# 2005".
"Use new shortcut in" set to 'Global'.
Enter "splitpane" in "Show commands containing" to get only the 2 desired commands.
Select the first one and remove any shortcuts already assigned.
Click inside the "Press shortcut keys" box and use "Ctrl + Alt + Up Arrow" for prev and down arrow for next.
If either of those shortcut chords are currently used by something else, you may need to search on that command and remove it from there. Then come back to the split pane commands and Assign.
Don't forget to close VS before you open another instance of it.
For Visual Studio 2010 (maybe others as well) F6 will work to jump between split panes if Tools -> Options -> Keyboard does not use the Visual C# 2005 keyboard layout additionally (which was the case for me for I-don't-know-why reasons - maybe I said yes to an installer/first-start question a long time ago).
Of course you will no longer be able to build your project with F6 afterwards. ;-)
For Visual Studio 2012: Tools -> Options -> Keyboard -> search by Window.Split and add a new shortcut.

Resources