Visual Studio 2013 - Search Short Cuts (hot keys) - visual-studio

In visual Studio, is there a way I can set up hot keys to quickly switch between searching in all open documents, entire solution or current document?
It is sooooo slow to have to use the mouse to change the option from the ctrl+f or chift+ctrl+f search menu.
...gregory

Please see this
https://msdn.microsoft.com/en-us/library/5zwses53.aspx
On the menu bar, choose Tools, Options.
Expand Environment, and then choose Keyboard.
this is a command for find in files 'Edit.FindinFiles' default hot key is 'Ctrl + Shift + F'.
You add any new short key as you like
Hope this help....

Related

Visual Studio 2019 Search History not in 'table'

Alright so I recently did a clean install of visual studio and one thing changed from last time.
With vs2019, I think, came the different looking "Search History". Here are two screens of what exactly I mean with that. New looking history and here is the old one
I'm just not sure why now I only get the old one. I found out that the new one only appears with CTRL + SHIFT + F and the older one with regular CTRL + F. Is there are way so that the default CTRL + F window displays the same output window? (the newest one)
At first I didn't really like it that much, but now I prefer it. I'm running VS2019 Version 16.5.2.
Edit: And also, this is where I used to get the table version if anyone was wondering. Now it's just this old text thing.
In the "Find in Files" tool window, ensure "Find results table" is selected, not "Find results 1 window":
You can customize the keyboard shortcut.
Go to Tools\Options
Navigate to Environment\Keyboard
Under "Show commands containing", type Edit.FindinFiles
Under "Press shortcut keys", press the desired keyboard shortcut (i.e. in your case Ctrl+F)
Click Assign and then OK
See screenshot here
Tools > Options > Environment > Preview Features > Check "Use
Previous Find in Files"
Ctrl+Shift+F > Open Result options > Select
"Find results table"
Close the Find and Replace tool window and
revert the aforementioned "Use Previous Find in Files" setting
(optional)
Perform a search (either Find in Files or simply through
the standard Ctrl+F find prompt) Your results will then appear in
the advanced tabular "Find results table" window.
Presumably this setting is also found elsewhere but I haven't been able to find it without turning off the Find in Files preview feature.
https://stackoverflow.com/a/63789479

Navigate to open files / open tabs

Problem: Some times I have many tabs open and finding a tab is not easy and fast.
Question: Is there any shortcut in visual studio or resharper that allow us to find a tab by typing part of file/tab name?
Example: Something like Navigate-> Recent files... of resharper:
Looking up the ReSharper 2017.2 Help - Navigation and Search I could not find any hint about navigating through active files.
Visual Studio allows you to navigate through all open tabs by using Ctrl + Tab. This allows you to switch trough all open tabs ordered by their latest use. Use Ctrl + Tab again for forward and Ctrl + Shift + Tab for backward navigation. But as you already mentioned with a lots of open tabs it could be slow stepping through all active files.
What I personally do in your situation, when trying to find a open tab or any kind of class/file/member, is to use the Ctrl + T shortcut. This opens the Go to Everything/Type … popup, which allows you to search for anything within you solution.
To find an item in your solution by the item's name
To use the unified access to all search results, press Ctrl+T to display a pop-up where you can start typing and find everything in your solution that matches your input.
If you want to limit your search to types (classes, interfaces, structs or enums), press Ctrl+T twice.
If you want to find anything by a plain textual match, press Ctrl+T three times.
If you want to search symbols (types, methods, properties, fields, and so on) - press Shift+Alt+T.
You can also limit the search to files in your solution by pressing Ctrl+Shift+T.
from ReSharper Help - Navigation by Name
More Shortcuts: Resharper - Default Keyboard Shortcut Schemes
Yoy can try set shortcut to open window with active tabs: Options -> KeyBoard -> Window.Windows
It will look something like this

Set Add Class shortcut key in Visual Studio

I used to used the shortcut Ctrl + Shift + C to add a new class in Visual Studio 2015. This seems to have gone away when I'm using a different machine. How do I set this?
I've looked in Options > Environment > Keyboard but I can't see anything obvious...
Navigate to Tools >> Options >> Environment >> Keyboard, search for commands containing Project.AddClass and setup the shortcut you want
Steps to setup a shortcut
Search any command like AddClass in Show commands containing box
Select a desired command
Click on the blank Press shortcut keys box
Press desired key / key combination for shortcut using your keyboard
Also, see article Visual Studio Shortcuts and Add on Tools...
This article explains the same in more detail with some other interesting (and perhaps even relevant) points.

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.

How do you keep Visual Studio tabs sorted

Is there a built in way, or a free add-in, that can keep the tab bar of open files sorted in alphabetical order? Once sorted, how can I get CTRL-PageUP/DOWN (or other shortcut) to jump left/right instead of most/least recently viewed file.
Thanks,
Kurt
In VS 2017, using the Productivity Power Tools extension you can navigate to:
TOOLS > Options > Productivity Power Tools > Custom Document Well
Here you'll see a 'Sorting' section, where you can select 'Alphabetically'.
With the new settings applied the CTRL + PAGE DOWN (or in my case, CTRL + ALT + PAGE DOWN) will just flip between next/previous windows.
--
In VS 2019, they aren't able to port the Custom Document Well extension so you'll have to vote for this feature to be added to Visual Studio instead.
--
I don't have VS 2008, so I'm not sure if the path to get to those setting is exactly the same. If you are unable to find it, you should be able to install Productivity Power Tools from the Extensions and Updates module (also located under TOOLS).
Hope that helps!
It is not perfect but the downward-pointing triangle just to the left of the X that closes the current editor tab does display all currently opened files in alphabetical order.
I use ReSharper's "Go To...":
(source: jetbrains.com)
Use the VS Studio extension "Sort Tabs/Open Editors by name" by omagerio.
Close all your tabs.
Go to this extension settings and uncheck "Sort by full path"
I always switch VS from Tabs to MDI. With tabs on, after working for a while there are so many documents the tab bar gets meaningless.
I use Resharper and Ctrl-T with CamelCase(CC) to get to my classes, or a simple old-fashioned Ctrl-Tab.

Resources