How to disable keyboard shortcut for Show all files - visual-studio

The Show All Files option in Visual Studio's Solution Explorer keeps toggling on for some reason. What shortcut key does it use and how do I disable it?

For some time now I would randomly find the Show All Files option enabled in solution explorer and I couldn't figure out what was causing it. Thanks to Keyboard shortcut for Show All Files I knew the keys but there was no keyboard shortcut bound to the SolutionExplorer.Folders.ShowAllFiles command. What's actually happening is that Alt+P opens the Project menu then pressing O will toggle show all files.
This was happening often to me because I use Visual Assist's Open File in Solution default shortcut Alt+Shift+O and would sometimes hit P on the way accidentally. To remove this shortcut and behavior you actually need to edit your menu items. Open the Customize menu (Tools->Customize) and remove both entries for Show All Files.

Related

Closing files with the Visual Studio Popup Navigator Window?

I'm looking for a quicker way to close files in visual studio so I can avoid X'ing out of a file, or hitting ctrl+f4. These are too slow for closing multiple files.
Is it possible to configure the popup navigator window (ctrl+tab) to close files somehow?
Like maybe clicking a file with the middle click on a mouse, or area dragging over a few files and hitting del?
I'd also welcome any other way of closing multiple files in a quick manner.
Works for me by clicking the middle mouse button down anywhere on the tab towards the top of the window.
Perhaps you could remap the keyboard shortcut from 'ctrl + f4' to 'ctrl + w' to mimic typical behavior of other applications? Keyboard shortcuts can be accessed through:
Tools>Options - then look for Keyboard under the Environment tab. To access the shortcut for closing a tab, search for Window.CloseDocumentWindow
Hope that helps - I'm unaware of any means to close multiple windows at once.

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

How can I close the solution explorer panel with a key-board shortcut in Visual Studio 2010?

I often need to jump from a file to another file that I don't have open to one somewhere in the project directory structure. I often use Ctrl-Alt-L to open the solution explorer panel, but then I'd like to close it after I open the file I'm after. Unfortunately Ctrl-Alt-L doesn't simply toggle the panel open/closed. Is there another way to accomplish this. Or how can I close the solution explorer panel with a key-board shortcut?
I believe you are looking for SHIFT+ESCAPE.
It will close any tool window currently in focus.
Turn on the Auto-Hide option for the Solution Explorer panel. Now you can open it with Ctrl+Alt+L and close it with Esc. Actually Esc will set the focus back to the code editor and the Solution Explorer will auto-hide itself.
It takes two steps:
CTRL + ALT + L to put the Solution Explorer into focus.
Then SHIFT + ESC to close the tool window currently in focus.
Thank you Smash for the second step.
Turn on Auto-Hide in the Solution Explorer panel, then press Ctrl + Tab and release only the Tab key, that will open this dialog with Active Tools and Active Files lists. Select your prefered item using the keyboard or mouse.

How to switch between header and implementation in VS2010?

Is it any keyboard shortcut or free addon in Visual Studio 2010 that allows to switch between header (C/C++ .h file) and implementation (C/C++ .cpp file)?
MS added this feature in Visual Studio 2013. It's a default keyboard shortcut Ctrl + K, Ctrl + O
To clarify: Keep Ctrl pressed, type K, type O, release Ctrl.
You can find the command this maps to from the customize-keyboard options as well (tested for VS2015):
Visual Studio does not have a built-in keyboard shortcut to switch back and forth. A macro is by far your best bet if you want to automate this with a single keyboard shortcut. For a list of suggested options, see the answers to a previous question.
The add-in Visual Assist X provides this feature with the shortcut Alt+O (however, add-ins are not supported by the Express editions of Visual Studio).
If you're trying to avoid using a macro, there is an alternative way to achieve a similar result, although it is a two-click process:
To switch from header to implementation:
Right-click a.cpp file and choose "Go To Header File" from the context menu.
To switch from implementation to header:
Right-click an identifier declared in the header and choose "Go To Definition" from the context menu.
My workaround to this problem is a bit unorthodox but it might help others, so I'll share.
I use the window list. And I thought it would annoy the heck out of me doing it this way, but I've actually gotten quite used to it. It continues to apply, even in Visual Studio 2012, so I'm offering it as yet another alternative.
Once both the .cpp and .h files are open, I switch between them like this...
To switch from .cpp to .h: Alt+W, W, Down Arrow, Enter
To switch from .h to .cpp: Alt+W, W, Up Arrow, Enter
You can actually hold down the Alt key while pressing the W the second time, effectively making it: Alt+W, Alt+W, Down Arrow, Enter (You don't have to release the Alt key until you type the arrow key)
This works because the .cpp and .h files are typically adjacent alphabetically in the window list. It also works for .c and .h for the same reason. Breaking it down: Alt+W goes to the "Window" menu, and the second W activates the "Windows..." window list viewer. The active window will be selected in the list box, so pressing the up or down arrow key will move to the document that is before or after alphabetically, which is almost always the corresponding .h/.cpp file.
As yet another alternative, I should also mention that if you place the .cpp and .h files beside each other in the window tabs, then you can use: Ctrl+Alt+Page Up, and Ctrl+Alt+Page Down to switch between adjacent tabs in the tabbed window list.
I realize that you have to "prepare" by having both documents open, and this is less than ideal, but I typically have all my documents open anyway, and I use the Alt+W, W shortcut a lot.
Such shortcut key is added in CodeMaid. CodeMaid is an open source Visual Studio extension
Ctrl + M then ,
http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496/
In VS2010 - The keyboard shortcut "EditorContextMenu.CodeWindow.GoToHeaderFile" does the same thing as the right click menu. Unfortunately it doesn't work as a toggle to switch back again. (Though, you can use ctrl - to go navigate back if you started in the cpp).

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