Reputation: 93
I use Visual Studio Code to work on projects that not only include program code, but also data files, e.g. in Excel format.
VSCode cannot edit such files, as they are binary. Attempting to do so shows a warning, and if you persist, the file is shown (as gibberish).
I've also tried to pass the file to the (CMD) terminal (right click, 'Open in Terminal'). In a regular CMD window that would invoke the default application, but that does not work in VSCode.
Is there a simple way that I can use from VSCode to open such files using the default applications?
Upvotes: 3
Views: 8246
Reputation: 180611
In v1.66 you can set a default editor for binary files and avoid the warning (see release notes: binary file):
Default binary editor
A new setting,
workbench.editor.defaultBinaryEditor
, lets you circumvent the binary file warning and automatically open the editor type of your choosing when a binary file is detected. You can select the default binary editor from a dropdown in the Settings editor or via IntelliSense insettings.json
.
TBH, I am still investigating whether you can set this to some external application like Excel?
Upvotes: 2
Reputation: 93
The extension sandcastle.vscode-open
does this. Install it, and you can open any file with its default application by right clicking on the filename in the explorer menu.
Upvotes: 5