How do you prevent Visual Studio 2012 from automatically closing preview files? - visual-studio-2012

Visual Studio 2012 appears to have a new feature that distinguishes between files that have been explicitly opened for editing and files that have been navigated to (these "preview" files default to the right side of the file tabs on the top of the environment and have a default tab color of purple).
While it is possible to keep a preview file open by clicking on the "Keep Open" button in the tab, I find myself looking for files that I expect to be open, but have been closed by Visual Studio without my direct input.
Is there a setting available that automatically converts preview files to open files (i.e. just skips the preview mode entirely)?

You can turn off Preview Tab, go to Tools / Options / Environment / Tabs And Windows and uncheck "Allow new files to be opened in preview tab", like in screenshot below :

Related

Design tab is not visible in Android Studio

Design tab is not visible in Android Studio. How to enable it ?
View - Window tools - viewer is not visible.
Thanks
I recently ran into this problem. Try File > Sync Project with Gradle Files. This can also help with configuration problems
The view that you are looking for is called the "preview" window in android studio.
You have to open a layout view in your project. Navigate to src/main/res/layout/ in your project and select the xml layout file you want to work with.
If the preview window doesn't automatically open up, you can open the view by selecting from the tool bar View>Tool Windows>Preview
There will be a "Design" and "Text" tab at the bottom of the xml layout.

Android Studio file type extension definitions

I created a new file (with .frag extension) within Android Studio, and a window "Register New File Type Association" popped up. I wasn't paying attention and I selected "Open matching files in associated application" which now makes it so any time I try to open a *.frag file it opens in Gedit (which I had open at the time of the file creation). I checked file types in Settings but I didn't see an option to change the association definition. I want my *.frag files to open in Android Studio.
register-new-file-type-association-dialog
I just made the same mistake.
Go to Setting
write 'file types' on the search box
select the 'File types' under 'Editor'
find the one you assigned and delete it.
I ended up setting Android Studio back to default settings using this link: Reset Android Studio settings to default setting on linux

How do I configure Visual Studio 2012 to launch an external editor

I'd like to configure Visual Studio 2012 / TFS to launch an external editor when I double click the source file in the Source Control Explorer.
I've seen where I can add an external editor as an External Tool, but don't see how to link that external tool to a particular file extension and to launch when double clicked.
Thanks!
Right click on the file in Solution Explorer / Open with / Choose Program / Set as Default
From comments:
I'm in the Source Control Explorer. I assume I can't do it from there? (I don't see menu options for Open with...).
Or from Source Control Explorer, I have an option "View With" in Visual Studio 2010 that works in the same way. I don't have it in VS2012, and a comment on this StackOverflow question suggests it may be provided by an add-in (perhaps TFS power tools, since I don't have any other add-ins installed in VS2010).
It may be that if you click on "Set as Default" from Solution Explorer to set an external tool as editor for a file extension, then this becomes the default for viewing from Source Control Explorer too. But I haven't tried this.

Turn off visiting behaviour when navigating to file in Visual Studio 2012

When I go to another file, using F12 on a type name in the code, it will open the file in a read-tab to the right. If I navigate further the new file will replace the previous one.
In Visual Studio 2010 it would open a new tab for each file I go to. I've tried to get used to the new behaviour, but I can't stand it.
How do I turn this feature off?
Visual Studio 2012 has a new Tabs and Windows settings page under Tools > Options > Environment that controls this kind of behavior:
You probably want to disable Allow new files to be opened in the preview tab in the Preview Tab section.

Disable file preview in VS2012

In VS2012 when you select a file in solution explorer it automatically opens file in a special "preview" tab.
Maybe my computer is not fast enough, but this preview is too slow for my taste.
How do I disable this feature?
In Tools > Options > Environment > Tabs and Windows, you can disable it by unckecking "Solution explorer" under Preview tab.
I find it using the "Quick launch" new feature. Simply type "preview", and a link to the setting will be suggested. Great new feature of VS
You can also toggle file preview within the Solution Explorer tool-window itself:
This may have been added in the July update because I hadn't noticed it before then.
One of the buttons at the top of the solution explorer toggles whether this is enabled.
On Visual Studio 2013 I have done this by this Icon :
An even better solution IMO is to completely disable the File Preview feature (not just for Solution Explorer):
Open Tools > Options
Navigate to Environment > Tabs and Windows
Uncheck "Allow new files to be opened in the preview tab"
This also prevents things like Go To Definition (F12) from using preview tabs.

Resources