Is there a way to quickly find files in Visual Studio 2010? - visual-studio

Does Visual Studio 2010 have a built-in way to quickly find/open files, similar to the Ctrl+Shift+O function in Eclipse?
Or does ReSharper offer this functionality?

Ctrl+,
I'm surprised no one gave the right answer:
Navigate To can show you a list of open files and lots more.
http://weblogs.asp.net/scottgu/archive/2009/10/21/searching-and-navigating-code-in-vs-2010-vs-2010-and-net-4-0-series.aspx
CTRL+COMMA is your friend.

Ctrl + Alt + A opens the command window, type "open" then start typing file names and it will dynamically autocomplete by available solution file name.

I use Ctrl + / to jump to the command bar (same as the search box, but with a > prefixed in the text). I then type "of" (for "open file") and start typing the name of the file to open. Possibly matches are automatically displayed by VS.
I also found that when using ReSharper, the familiar Eclipse shortcut for Open Type (Ctrl + Shift + T) is mapped to ReSharper's GotoFile command.

There is also another way to find files in the Visual Studio 2010 might be useful for someone.
In the command box in visual studio toolbar type ">of " and start typing the file name it will prompt list. Note: This will only find the class not the pages try it for yourself.

this addin will very usefule to quickly open files from visual studio by pressong CTRL + K + O
http://visualstudiogallery.msdn.microsoft.com/en-us/3eb2f230-2728-4d5f-b448-4c0b64154da7

In VS2017 or later versions, we have command called "Edit.GoToAll".
SO can configure it from VS tools.
see below snap.
I have configured my keys for file search as CTRL + SHIFT + T

CTRL+SHIFT+F will bring open a find in files search dialog box. The result will be listed, usually, on the lower section of VS in a Find Files result box. Double clicking a result will open it

DPack has a dialog for finding files in the current solution (search all, or only open files), and it also has a dialog to search the current file for methods,properties, etc. Very nice! Note that the current version only supports VS 2012 or newer, but they have binaries there for older versions of VisualStudio as well:
http://www.usysware.com/dpack/
You could also try Sonic File Finder, which does something similar to CTRL+COMMA:
http://www.jens-schaller.de/sonic-tools/sonicfilefinder/overview/overview.htm

In Eclipse, Ctrl+Shift+O = "Organize Imports"... which I am not sure what this is. But it is not the Ctrl+Shift+F = Find in Files that is in Visual Studio.

VSFileNav - An extension that I created that allow rapid file searching. It's basically got all the ReSharper functionality that was disabled in the express version of VS2010 (I used to really like this).
It's also free :)

For file name search, I use the Visual Studio Productivity Power Tools.
It adds a tab to Solution Explorer called "Solution Navigator". It shows all the solution files in a tree and has a search bar at the top.
To search for text in all your solution files, use Entrian's Source Search:
https://stackoverflow.com/a/9994522/24267

Visual Assist comes with something like this. You will have to pay for the plugin (and I don't think you can use plugins in the express versions).
(If you're doing C++ and you don't plan to buy Visual Assist, be sure to never install the trial. It's that addictive.)

I usually use Ctrl+Q or Everything tool via a hotkey.

For fuzzy search of files (and more) I needed to use cmdp

Unfortunately, VS doesn't offer this search-as-you-type functionality (and lots more).

Type >open filename in the command box in the Visual studio can also open the file

NavigateToAll extends the built-in Navigate To by enabling you to open any file on the disk (not just the ones in the solution).

CTRL + P, the right solution for me....
CTRL + , -> SETTINGS

Related

How to replicate SublimeText ctrl+D in Visual Studio

I am used to work with Sublime text and trying to switch for Visual Studio for bigger projects, one of the feature of sublime that I absolutely love is its multiple select feature. You can hit ctrl + d multiple times to select next instance of the same word and then rewrite them all at once. Is there anything like this in Visual studio? I tryed to find it, but with no success.
Btw I am using Visual Studio 2015.
Visual studio 2017-19
The default shortcut is Alt+Shift+.
But if you want to add Ctrl+D
Go to the menu Tools > Options then select the Keyboard tab on the left
At the top you'll find an option to add extra keybindings, select Visual Studio Code. Save and That's it!
This works because Visual Studio Code has Ctrl+D, and other shortcuts similar to SublimeText
Alternatively you can manually add shortcuts
In the image, you can find any command to customize in the middle section.
The particular command you are interested is the one selected Edit.InsertNextMatchingCaret
Ctr R, R, this is used to replace the name of the varibals, depronto can serve it.
and you are encouraged here are all the shortcuts of vs2015 http://visualstudioshortcuts.com/2015/
Goto Tools / Options / Keyboard
Search for duplicate
Choose Edit.Duplicate
Remove the assignement for the current shortcut
Assign the shortcut you want
Ctrl + Shift + L seems to work.
Use Alt +leftClick and ctrl+F2 . For more reference you can go Official Website [link]https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-shortcuts-reference
I decided to use this Visual Studio Extension:
https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.SublimeVS

VS2012 is missing "format document" feature

I have VS2012 Pro installed, and there is no "Format Document" feature under Edit -> Advanced. I used this all the time in VS2010, and would like to continue using it. Is it just not available in the Pro version of 2012?
It is missing from the menu but you can still access is via shortcut
Ctrl+E,D
If you're talking about other types of files other than .cs, I think VS will generally go by the file extension.
I was trying to edit a .txt file with xml in it and couldn't get the menu option or the shortcut keys to work. Then renamed the file to .xml and all was good.
In VS2012 the command is there as well. It depends on the current settings. I still have it under Edit -> Advanced where it shows the Ctrl + E + D shortcut that is assigned to it.
Please check the following:
Go to Tools -> Options -> Keyboard and check which additional keyboard mapping scheme is applied in the drop down on top. For me it states "Visual C# 2005"
Then, as Jarek already suggested search in the 'Show command containing' for 'Edit.FormatDocument' and see if there is a shortcut assigned now.
Which kind of environment have you choosen when installing VS 2012? Was it for C#? If you want to change that you can do it unter Tools -> Import and Export Settings as described here
Last but not least I'm not sure any more if this function actually is part of Visual Studio 2012 itself (I'm 98% sure it is, but 98 is not 100) so please check if installing the PowerCommands extension solves this issue (Even though the name suggests that they are only for VS 2010 they also support VS 2012). Note that the PowerCommands are also integrated now in the ProductivityPowerTools directly.
It's called "Reformat Selection" in XML Editor toolbar.

Visual studio shortcut keys equivalent to eclipse shortcut keys

I use both eclipse and visual studio (2008 right now) a lot. But there are some shortcut keys from eclipse that I really miss in Visual Studio that I haven't been able to locate. Does anyone know if these exists in Visual Studio?
Being able to search in your open window tabs - this is Ctrl+E in eclipse I think? I know you can navigate, but not search.
open type
open type heirarchy
open resource
move selected lines up or down (Alt+Up/Down)
move to last edited line (NOT Ctrl+- / Ctrl+Shift+- in VS and not Ctrl+Z, which only works if you're in the same file?)
If they don't exist, anyone got a good resource on how you can program shortcuts yourself for VS?
Just published new extension for Visual Studio:
Meet IntelliCommand (Visual Studio 2010/2012 extension)
This may help you for the moving of selected lines: Visual Studio: hotkeys to move line up/down and move through recent changes
Still searching on the others.
There is an "AsEclipse" plugin that should provide most functionality:
https://visualstudiogallery.msdn.microsoft.com/99ede732-544c-4f3b-8e38-49e4b8395075
I am a first time user of VS. Open Resource and Open Type look to be pretty well covered by Search in Solution Explorer, which is accessed using Ctrl+;
Go to Settings keymaps and search for eclipse.
If you install Eclipse Keymap from Alphabot Security plugin in VS Code.
It has most of the shortcut from eclipse.
install telerik justcode... it has all shortcuts you just need to change them to be like in eclipse ... works like a charm after 15mins
I'm not sure if following are VS or ReSharper shortcuts:
open type heirarchy: Ctrl+E, Ctrl+H
move selected lines up or down: Ctrl+Shift+Alt+UP/DOWN/LEFT/RIGHT
To get eclipse like shortcuts in vscode:
Please go to:
Ctrl+Shift+p and type java: Overview
open overview using enter
there is option under Key Bindings
Use Eclipse Key Bindings
just click it.
and you will get all eclipse shortcuts in vscode

Alternative keyboard shortcuts to Resharper's "Open by filename" or "Open by typename"

Resharper has some commands I just can't live without (keybindings are given for the Visual Studio template):
Open by filename (Ctrl+Shift+T)
Locate in solution explorer (alt-shift-T, useful only when solution explorer is configured not to track the current file already)
Does visual studio have alternatives to these that don't require Resharper? I know VS2010 adds the "Edit.NavigateTo" command (Ctrl+,) but it is slow and shows every useless symbol that might be what you want (too noisy).
Is anything similar offered by other perhaps free addons?
You might want to try the Solution Navigator feature that is bundled with the free Visual Studio Productivity Power Tools extension. It appears to have more powerful support for searching for files and symbols all combined within the Solution Explorer.

How to locate a file in Solution Explorer in Visual Studio 2010?

I have a huge solution with multiple projects. Sometime I need to navigate to a file in Solution Explorer. Using the VS 2010 'Navigate To' feature I can open any file by name in Visual Studio 2010 but I want to be able to select the file in Solution Explorer as well?
There's an option to track the active (open and viewed) item in the solution explorer. If the file is in view, the file in the solution explorer will be selected.
Tools->Options->Projects and Solutions->Track Active Item in Solution Explorer
VS2012 added a new command called SolutionExplorer.SyncWithActiveDocument. The default shortcut for c# is Ctrl+[,S
This command will navigate to the active file in the Solution Explorer.
Also, it seems that you need to have the "Track Active Item in Solution Explorer" option turned off.
With ReSharper installed Shift+Alt+L will find the current file in Solution Explorer in Visual Studio 2008+.
I found the track option to be a little annoying.
I prefer to use DPack. It contain "Locate In Solution Explorer" operation, plus many other features (some are less powerful in VS2010, like their browsers), and it's free.
Note that ReSharper also have the locate feature that works batter than DPack's (in some cases, DPack's locate won't work if the file is collapsed behind folders), but you don't want to buy ReSharper only for this feature.
Brian Schmitt has a great Locate File in Solution Explorer – Visual Studio Macro post for this. The macro is extremely simple and quick. Basically it toggles the setting
Tools->Options->Projects and Solutions->Track Active Item in Solution Explorer
so that the current file ends up selected in the Solution Explorer but, because it is not left on, you don't get irritated by Solution Explorer nodes being expanded for all the files you access.
Public Sub LocateFileInSolutionExplorer()
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
DTE.ExecuteCommand("View.SolutionExplorer")
End Sub
Bind a Keyboard ShortCut to this custom macro to effectively create what should be a built-in Visual Studio feature.
If you have ReSharper and want to add "Locate in Solution Explorer" to the tab's context menu:
Go to Tools -> Customize -> Commands -> Context Menu
Select "Other Context Menus | Easy MDI Document Window".
Click "Add Command".
Choose "Resharper" -> "ReSharper_LocateInSolutionOrAssemblyExplorer" (in VS2019, the category name was changed to "Extensions")
"OK" -> "Close"
Now, when right click on any tab and you'll see a new option: Locate in Solution Explorer.
UPDATE:
Following the comment from #jeremy-paskali, you can set a keyboard shortcut for this command:
Go to Tools -> Customize -> "Keyboard..."
Search for "ReSharper.ReSharper_LocateInSolutionOrAssemblyExplorer" in the "Show commands containing" field and select it.
Review the currently assigned shortcuts in the drop down below.
Make any changes, if needed.
"OK" -> "Close"
Visual Studio 2012 has a new shortcut Ctrl [, S. Yes you have to type Ctrl [ and then release and then immediately type S (or click the little sync icon at the top of Solution Explored). It will synchronize to the item.
Of course you can change the shortcut. I think I'll try Alt+L for locate.
If you want to change the shortcut, it's command name under Options\Environment\Keyboard is SolutionExplorer.SyncWithActiveDocument.
Usually this is more useful than always tracking, which in older versions always was a disaster because it would track 100 items in a row and then be jumping all over the place...
I know its little too late, but hope it helps someone else. The best option now is to install Microsoft Visual Studio add on called - Productivity Power Tools.
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef
With this comes "Solution Navigator" (alternative to Solution Explorer, with a lot of benefits) - which then you can use to filter the files to only show "Open". You can even filter files to show "Edited" and "Unsaved".
In the event you want to only track the current file through a
keyboard shortcut - the activity is
"View.TrackActivityinSolutionExplorer" (assign keys here -> Tools -
Options - Environment - Keyboard)
Credit (James' comment)
This worked for me
There are several build-in ways you can accomplish this nowadays:
Configure VS to track the active item in Solution Explorer: This can be accomplished by selecting "Track active item in Solution
Explorer" at
Tools > Settings > Projects and Solutions > General
Use "Sync with active document": This can be accomplished in 2 ways.
Firing the SolutionExplorer.SyncWithActiveDocument command by using the default key combination CTRL+]+S
CTRL+)+S if you happen to be using an AZERTY keyboard like me.
By using the "Sync with active document" button on top of the Solution Explorer. The button looks like 2 apposing arrows on top of each other.
If you're version is older then VS2019 Version 16.10.2 then this button looks like this:
From VS2019 Version 16.10.2 onwards this button will look like this:
And yet again Microsoft has changed the button icon in more recent versions of VS 2022:
In Visual Studio 2010 you can turn on the "Track Active Item in Solution Explorer" option. This will mean whenever you switch between documents the new document gets selected in Solution Explorer. This can be irritating if your solution has lots of folders, because as you move around files in your solution all the folders will be left open.
Visual Studio 2012 introduced the new "Sync with Active Document" feature. Three is a button for it at the top of Solution Explorer, or you can use the shortcut Ctrl + [, S.
This is actually built in to visual studio without the need for ReSharper (which I love BTW).
http://blogs.msdn.com/b/zainnab/archive/2010/03/29/track-active-item-in-solution-explorer-vstipproj0011.aspx
If you want to select the file in the solution explorer on command and don't want to install anything then I would recommend this macro.
I've tested it, setting the shortcut to Alt+T, and I can confirm that it works with VS 2010.
Thanks to Dan Vanderboom for writing it.
For Visual Studio 2017 using a French AZERTY keyboard the command is the same as stated by Aaron Carlson but the keyboard shortcut is different.
The AZERTY keyboard shortcut to navigate to the active file for c# is Ctrl+),Ctrl+S
I checked the shortcut hadn't changed for QWERTY users in VS2017 on this page
http://visualstudioshortcuts.com/2017/
Visual Studio doesn’t offer an easy way to locate the current file you’re editing in the Solution Explorer on demand. You can set the solution explorer to always stay in sync with this simple setting:
Tools > Options > Projects and Solutions > General. Check “Track active item in Solution Explorer”.
Thanks to Cory House

Resources