Switch from Compare Files in Visual Studio to normal file view - visual-studio

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

Related

Edit.GoToAll command in Visual Studio does not show file name suggestions

Context
I use this command with the shortcut Ctrl + T (alternatively Ctrl + ,) to quickly navigate to files in my solution (WPF app if relevant). As I do not remember the exact file names I would (until recently) use the suggestions that were showing below the prompt to find my files as in this example:
Navigation with suggestions
Source of example
Since I last started VS I get none:
Navigation without suggestions
Attempts
Restarting and updating visual studio didn't help. Neither did deleting the .vs file of the solution. I also toggled the statement completion fields in Tools > Options > Text Editor > All Languages, saw no change.
I believe this might be some Intellisense error but I am not sure. I would be thankful for any guidance or information.
One possible cause is somehow you had collapsed the list. If you hover over the point in the picture below you should get a resize handle. Grab it and pull it down to get your list back.

VS2013: How to rename a file from within the file contents window using only the keyboard?

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.

visual studios 2012 after opening one file, I cant find the previous file I had open in the Document Well

Anyone know how to make the document well act like vs2010? Every time I open a file in the solution I lose the previous file unless I pin it. I want it to act like a stack.
Thanks
Nick
I you double click a file you have the same behavior as in VS10. You can deactivate the preview function in solution explorer (i believe one of the right buttons - unfortunately I have no VS12 by the hand at the moment, so I can tell the exact position).

Visual Studio 2012 Highlight all open files in solution explorer?

Question:
Is there a way to make all files that are open in visual studio be highlighted in the solution explorer?
(I know there is a filter that you can filter it to show only open files but this dos me no good sense I am looking for a file that may not be open, I am not even sure what the name of the file is until I open it up and say there it is.)
Example Imagined GUI result: (Different colors are fine)
https://docs.google.com/file/d/0B31DHM9TkK99S3pWSms3QXR2Qk0/edit?usp=sharing
(image of what i am thinking, can not post image right now)
Solution Explorer
-Solution
+Stuff
+More stuff
-Code
+MyOpenFile.cs (Highlighting)
+MyNotOpenFile.cs
+MyOtherOpenFile.cs (Highlighting)
+MyCurrentlyOpenFile.cs (Highlighting, maybe a different color)
(the one with the red under line could be the active tab)
Background:
I don't know if this happens to any one else, but I have been doing it a lot for years now. While working on something I go to open up a file in the solution explorer and it turns out that the file is already open, and so visual studios just sets that file as the active tab. If I were working In just one window that would be fine, but I have few tab windows open beyond the main window and they are normally on a diffident monitor, so when the tab becomes active I do not see it at all, because it is not on the main window. This is even worse when I go to preview a file.
Icing on this cake:
-If it would have an option to highlight the parent nodes of open files, i the example "controllers" and "content" folders would be highlighted as well.
-If there was something that would do this for vs 2010 as well would be great.
I am looking for all most any thing at this point, an extension, a style sheet some where to edit, or as a last resort a good reference to a "How to code Extensions for Visual studios" website.
Edit:
As a point Of clarification I am not looking for a way to locate a specific file in the solution explorer, I am looking for a way to make the files that are open look visually different, so that I know to look around a bit before thinking that VS2012 is crashing or the file is messed up.
try an extension called VS commands. It will help you locate the files in solution.
Or this extension:
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/

In Visual Studio when viewing a changeset, how can I change the view of cs files?

In Visual Studio with TFS as source control, when I view the history and double click a cs file, the file is loaded in notepad. How can i change the application to be notepad++?
I also would like the OS's default application for the file to still be visual studio
After pouring over ProcessMonitor logs I think I found the solution!
You need to change the what the Windows shell (explorer) thinks the "Edit" action for text files. I was able to change this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\text\shell\edit\command
to something other than Notepad (in my case notepad2). Now Visual Studio's TFS's changeset dialog opens cs files with that editor.
This will probably change the edit option for not just cs files, but everything considered "text'. The registry entries for file associations are pretty complicated. I suspect that it would be possible to disassociate .cs files from this common "text" category and make this change only for cs files (but I'm not that ambitious). Also, I wouldn't be surprised if people's file associations / shell commands (open, edit, etc...) vary from machine to machine (OS versions, tools installed, etc) - so YMMV.
The only way I found is to replace notepad with notepad++. This article describes how to do it. Don't forget to check the comments to get a link to the "little exe" that comes with notepad++.
Works like a charm on W7 x64.
Cheers,
Phil
\I was able to configure this by adding new value to the registry.
OS: Windows 7 Enterprise x64
Steps on how to do it.
Run: Regedit (alt + r, type regedit)
Look for HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations
Right click "SystemFileAssociation" -> add new key then name it as .cs
Right click .cs and add new key then name it as shell
Right click shell and add new keys name it as edit and open 6
Right click edit and add new key command then change the default value to point to the file exe you want it to run.
ex: C:\Program Files (x86)\Notepad++\notepad++.exe %1
Don't forget to add the %1 at the end of the .exe
do the same for open
Hope it helps.
I don't see any options in Visual Studio for changing that, so I'm guessing it uses the system's default text editor.
Try assigning Notepad++ as the default handler for *.cs files.
You can do this from withing Notepad++ by going to Settings/Preference/File Association.
You can also do it by right-clicking on a .cs file in explorer, go to Open With/Choose Program..., then select Notepad++ and check the "Always use the selected program to open this kind of file" box before hitting OK.
The only thing that works for me is when I set the default program for the particular file type in Windows Explorer to open with the VS IDE:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
This opens the code in a new instance of VS. Not ideal, but at least it's easier to read.

Resources