How do I open my Windows terminal settings in Visual Studio Code - visual-studio

I have Visual Studio and Windows Terminal installed in my PC. When I click the tab drop down and select Settings, the settings.json (Alt+click Settings for defaults.json) opens in Notepad. How do I configure to open the files in Visual Studio Code?

When you edit Windows Terminal settings (Ctrl+Alt+comma, by default) it loads the JSON file using whatever editor is configured to edit JSON files, system-wide.
One way to change that is to open File Explorer, navigate to (or create) a JSON file, then right click on it and look for "Open with..." then "Choose another app".
Pick VS Code and select "Always use this app to open .json files".

Related

How to open file with double click in Visual Studio?

By default if you navigate in Solution Explorer and just point on some file Visual Studio immediately open this file for editing. I would like to change this behavior and open files with double click
Like written here (but it for VS Code)
https://stackoverflow.com/a/57233522/5709159
How to change this settings?
In "Solution Explorer", click on "Preview Selected Items".

How can I make Visual Studio open .linq files in LinqPad.exe rather than it's own editor

I have a VS 2017 solution that contains some .LINQ scripts. When I double click those files in the solution explorer in VS I'd love to have them open in LinqPad (the default system editor) rather than a VS text editor.
Is there a way to configure VS to do this? I tried Tools->Options->Text Editor->File Extensions but none of the options there seemed like it would open something outside VS.
I realise this is an old question and I don't have VS2017 but just in case it is applicable, VS2019 provides this functionality. If you right-click on the .linq file in Solution Explorer and choose "Open With..." you will be presented with a dialog similar to below:
LinqPad may not be in the list. If it's not then click "Add..." and navigate to where it is installed and choose the LINQPad.exe executable.
Make sure to click "Set as Default" and then click OK.
Opening the file from Solution Explorer should now open it in LinqPad rather than Visual Studio.

How do I add a default Run As Administrator when I open a sln file from the command prompt or Windows 7/8 Jump List menu?

I have been researching around the web trying to figure out how to add Run As Administrator as the default menu item for a Visual Studio solution when you:
right-click the solution in Windows Explorer
right-click on a pinned application, such as Visual Studio 2013, to bring up the Jump List and then select the solution
The instructions that I have found so far:
http://www.howtogeek.com/howto/windows-vista/add-run-as-administrator-to-any-file-type-in-windows-vista/
show how to easily add the Run As Administrator menu item to an existing file type. You just have to find the right registry keys for the Visual Studio version that you're working with. For example, Visual Studio 2013's registry key for its solution file type is:
[HKEY_CLASSES_ROOT\VisualStudio.sln.12.0]
Then you just copy the Open command under the shell key, then paste it in as a new key whose name is runas.
After that change, when you right-click on the solution in Windows Explorer, Run As Administrator is in the list of commands. But it is not the default.
To open the solution as Administrator from the Jump List menu, when you right-click on Visual Studio as a pinned icon, you have to right-click on the solution file in the Jump List, then select Run As Administrator.
But I couldn't find anywhere about how to make the Run As Administrator the default command in this menu.
So how do you do that?
Easiest way is doing this:
Right click visual studio and open file location.
(If it's the shortcut, right click then click properties. On the bottom click on "Open File Location")
This should lead you to devenv.exe.
Right click this and select troubleshoot compatiblity.
Select troubleshoot program and check off the box for "The program requires additional permissions" and select next.
Now if you open visual studio from where ever, it'll open it as an administrator.
It actually turns out to be one additional registry entry that needs to be set. In the shell key under the file type, change the value of (Default) to be the same name as the command in the registry under the shell folder.
For example, to set Run As Administrator to be the default, you would set the value of (Default) in HKEY_CLASSES_ROOT\VisualStudio.sln.12.0\shell to be runas.
When exported, this setting looks like this:
[HKEY_CLASSES_ROOT\VisualStudio.sln.12.0\shell]
#="runas"
Now when you right-click the solution in Windows Explorer, or when you right-click the solution after right-clicking to bring up the Jump List on the Visual Studio 2013 pinned icon, Run As Administrator is the default command instead of Open.
So you can confidently open the solution itself from Windows Explorer or the Jump List menu and watch as Visual Studio opens as Administrator.
Updating answer for Visual Studio 2015 (under covers version "14.0"). Tested on on Windows 10 Pro v1703 Creators Update. Picture below illustrates the first registry change. Second change goes one better - no need to right-click the jump list item at all.
Windows Registry Editor Version 5.00
;To add "Run As Administrator" to Visual Studio 2015 Taskbar Jump List solution right-clicks
[HKEY_CLASSES_ROOT\VisualStudio.sln.14.0\shell\RunAs]
[HKEY_CLASSES_ROOT\VisualStudio.sln.14.0\shell\RunAs\command]
#="\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe\" \"%1\""
;To make Jump List solutions open As Administrator by default
[HKEY_CLASSES_ROOT\VisualStudio.sln.14.0\shell]
#="runas"

Visual Studio Team Explorer can't properly open a PDF file - Solution Explorer not available for "open with" setting

We have PDF (and other) files attached to TFS Work Items and in Source Control under TFS. They are not opened correctly (they show up as ASCII, basically) in Visual Studio.
The problem seems to be that until you use the 'Open With..' dialog from the Solution Explorer, VS doesn't properly associate a program with extensions like '.pdf'.
If our users had a full installation of Visual Studio, that would be an ok work-around. However, many of them only have Visual Studio 2013 with the Team Explorer component - no Solution Explorer at all.
I'm guessing that there must be some workaround for this case. Perhaps setting the proper registry value? Since VS properly remembers the association if you can tell it (through the Solution Explorer), it must be stored somewhere.
Ideas? Suggestions?
If you've got a PDF file in a project you can right-click in the solution explorer and choose "Open with..". Now you can choose which editor you want to use. If Acrobat isn't already listed you can add it and after that click the button "Set as default".
After that, your PDF's will always open with Acrobat Reader regardless if you open it from source control browser or elsewhere in the Visual Studio. But you need to configure that for all your Studios.
Reference: Answer in MSDN "Source Control Explorer Doesn't View PDF Files"
"Open with" is not available in context menu. But I found solution - well better said workaround:
You have to create external command to open this pdf file in you pdf viewer.
Go to Tools/External tools.
In command section, enter path to your PDF viewer (exe file)
In Arguments, choose "Item path". Save it under preferred name
Put this new command you created in some of existing toolbars or create new one for it. This is also little complicated, so here is how:
Hit the small arrow next to the existing toolbar, choose customize
In the new window, choose "Add command"
In the new window, your new command is hidden under the category "Tools" as command "External command 1". Add it and confirm.
Now here comes the nasty trick. This command will not work in the browser window with PDF file selected, the argument is empty :(
So you have to OPEN the pdf file into that ASCII window and THEN hit the new command. Now the file will open in you selected pdf viewer.
Hope this will help someone

Visual Studio Sourcesafe 6.0 *.js filetype change default editor

I'm using Microsoft Visual Studio Sourcesafe 6.0.
When edit *.js(JavaScript) File Type, the default text editor is notepad.exe, but I want to use another text editor.
How to change *.js File Type default text editor?
By default, you can use notepad to view JavaScript source code. To change it, follow these steps:
Quit Internet Explorer (if it is running).
Double-click My Computer.
On the View menu, click Options (or Folder Options).
Click the File Types tab. In the Registered File Types box, find JavaScript, click it, and then click Edit. Then select your editor.
Note: If it is not works, you may need to type a space and %1 at the end of the command. For example, if you want to use Notepad to be your default HTML editor, type the following command: c:\windows\notepad.exe "%1"
OK, click Close, and then click Close again.
Reference: http://support.microsoft.com/kb/163606/en-us
Does it really work? I don't know. But try it, please.
this can be easily done via Tools->Options menu in Visual SourceSafe Explorer. How to: Change the Default Editor

Resources