I want to search for file names ending with 'E' and having file extension as .h in visual studio 2013. I know there is ctrl+shift+F dialog but it doesn't search for file names. Similarly ctrl+, dumps everything even file contents. I just want to search for file names. How to do this?
Thanks
You can use the Search Solution Explorer. Shortcut - Ctrl + ;
This is a small field on top of the Solution Explorer.
Type the following in the field: *E.h.
Needless to say * acts as a wildcard character matching 0 or more characters before E & the file would have an extension .h.
Related
When I compare a file with its unmodified version in Visual Studio from Team Viewer, the Compare Files view is opened. The head version of the file is displayed on the left, the working copy on the right.
Is there a way (preferably a keyboard shortcut) to quickly switch from the Diff viewer to the normal file view of the working copy?
The fastest way I have found is using the following shortcut:
CTRL+', S to Sync Solution Explorer with active Document
And then simply Enter to open it.
The best I have found is to use CTRL + O, [file_name], Enter.
In my 2017 version of Visual Studio will bring up the "Open File" pop up window in the directory of the file you are currently looking at. You'll then need to retype part of the file name in order for Windows to suggest files for you to open.
I don't think it's quite what you wanted but at least you can do it without having to resort to using your mouse!
Note that you don't necessarily need to type the whole of the filename in as you can use the down key to toggle through suggestions offered.
This combination works for me:
Ctrl+Alt+L to open Solution Explorer on respective file
Enter to open the file
I have changed the name of a C# class in my application and as I use one class per file as a personal convention I'd also like to rename the file itself. I avoid using the mouse while programming but every time I have to popup the Solution Explorer (I leave it hidden), look for the file and rename it there, so much effort for a simple task. I tried to find a way to rename the file from within the file content window itself but could not, and couldn't find an answer if this is possible or not.
Does anyone know if this is possible? And if it is, how can this be done? Thank you
If you rename the filename in the Solution Explorer instead of the class name in the editor, Visual Studio asks you if you also want to rename the class.
If that's not what you want you can open up the Solution Explorer with Ctrl + ;. If you check the option Track Active Item (Tools -> Projects and Solutions -> General), VS will automatically jump to the current file. If that's a little to much, there is a Sync button at the top of the Solution Explorer that you activate with Ctrl + [,S. Renaming a file is done with F2.
Is there any easy way to get the list of classes from VS.Net 2008 to a text file or an excel sheet.
I just want to make a list of classes that I have in a solution.
In class view, Goto Class View Settings , Deselect all the unwanted items as per your need.
Select all the classes that you need. Now you can copy paste into any where.
1 possible way would be use find all (Ctrl Shift f is shortcut) within VS and search for Class and ser Look at these File Types as being *.cs and also for result options set "Display File names Only"
Is there a way to navigate between tabs in VS similar to the emacs iswtichb-mode or Firefox ubiquity switch tab mode (https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial#Switching_Tabs) ?
In these apps, you just type a substring of the title of the tab (or buffer for emacs) to switch to this tab. For instance, to switch to a tab named "App_Code/Data/MyProgram.cs", you just invoke the tab switching command and then type "Progr" for instance to list all the tab whose name matches this string, including "MyProgram.cs".
It's much easier to switch between tabs this way when you have a lot of documents open and when you now where to go (which is the case in most situation)
Thank you !
Visual Assist has a function "Open File in Solution" (shortcut Shift-Alt-O), where you can type the filename and list of matching files from the solution is shown. Once you are happy with the selection, you can confirm it by pressing enter, or you can click the file you like with mouse.
As added bonus, this way you can also switch into files which you do not have open in a tab yet.
No this is not a supported operation in Visual Studio. It can be done by adding a Macro or via a plug-in though.
ReSharper will do something similar to this for you. It's not free, but it has many really nice features.
Invoke with Ctrl+T, then start typing the name of a file. It will provide you with a list of matches while you type. It's not limited to open tabs; it searches all files in the solution.
The search is intelligent. For example, if you have ThisIsMyClass.cs, typing 'TIMC' or 'ThisIMCla' will still match based on the idea that capital letters begin new words in file names.
Is there a way to limit a search (via the "Find and Replace" dialog) in Visual Studio to specified folders or file types?
Yes, in the find/replace window you can:
specify the file types in the "Look at these file types" option
and choose the folders in the ... button of the "Look in" option.
I can't believe this issue still exists in VS2015. We have a solution explorer folder tree. Why is "Current Selected Folder" not an option in the drop down. The "..." doesn't default to starting in the solution folder, I have to browse across the network to t the share, then drill down through all the folders to get at a folder that is ALREADY right there and selected in the solution explorer. Dreamweaver has had this functionality for its search for at least a decade (maybe longer).
Click Find in Files
Choose search folders three dots button "..."
Choose desired folder
Verify folder name and click desired action
Fastest folder search in VS:
As said in other answers, there is no immediate way to limit your search to a given folder within the current solution. (There are at least 3 feature requests for this in visualstudio.uservoice.com that have all been closed for lack of upvotes.)
But here is the fastest workaround that I could find.
Works without leaving VS and with keystrokes only (no mouse action required):
In Solution Explorer select the folder to search within.
Press Ctrl-C (copies folder path to clipboard).
Press Ctrl-Shift-F to open "Find in Files".
Enter your search term, then press Tab to forward the cursor to the "Look in" field.
Press Ctrl-V to paste in the folder path from clipboard.
2020-Update: Actually you can select the folder (also the current directory with two clicks) and define file types in Microsoft Visual Studio Professional 2019, Version 16.7.5
While the Choose Search Folders works, it could be much better. I would really like to choose folders to exclude as well as include because sometimes folders are nested. You may want a folder but only some of the subfolders.
But by far the worst inconvenience is that it is not stored with the solution. If I go to the trouble of defining a search, and close VS, then reopen, I have to define it all over.