VIsual Studio Code Plain Text Files - visual-studio-code

I have been searching for over 30 minutes but can't find the solution. On my Windows installation of VSCode when I create a new file (default to Plain Text as expected) and I go to save, it defaults to saving with a .txt extension. On my Mac though it defaults to All Files. I have searched through settings and I don't recall changing anything on my Windows machine but I WANT to save new files that are Plain Text with .txt by default on Mac. What am I missing?

Related

How to prevent vscode as default program to run html file?

When I double click a html file, it will be automatically opened in vscode. I set Firefox as default program and it works fine, but every time after I reboot, Visual Stadio Code - URL Handler still be the default program to open a html file.
I use linux mint 18.3, it only happens after vscode upgrade to 1.28
Right click on the file in the chosen format and choose Open With... -> Other Application or Open With Other Application.
Don't forget to check the Remember this application for "..." files checkbox to apply your selection for all files of the same format.
As discussed here

How to open a binary file (e.g. Excel) in Visual Studio Code with its default application

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?
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.
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 in settings.json.
TBH, I am still investigating whether you can set this to some external application like Excel?

VSCode is appending unsupported text encoding on file save

Not sure what's up with VSCode after updating to Version 1.10.2 VSCode is appending weird characters automatically after saving the file.
If I try to open the file with VSCode I get the following error.
The file will not be displayed in the editor because it is either binary, very large or uses an unsupported text encoding.
This only happens sometimes, not on every single save to disk action.
I'm using a SAMBA share, not sure if that has something to do with it.
I'm on MAC 10.12.3
** Update 3/16/17 **
Here is a gif of how it's happening.

VS Code open last files

I gave a chance to Visual Studio Code as my primary editor. I had been using Notepad++ and afterwards I have been using Sublime Text 2 and 3 for few years. I do see potential of this editor and I really like it, but there is one thing I am strongly used to.
Notepad++ and Sublime Text has this feature, I can edit file and DON'T save it anywhere. After restart Notepad/Sublime Text this file is there ready for me.
Other workflow could be open any file from my local storage, close VS Code and start it again. This file will not open!
I know about that when I open folder and restart VS Code, folder is open and files as well. But is there any way how can I manage to have opened files after restart without having opened folder?
Edit: This is now implemented:
// Controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.
"files.hotExit": "onExit"
I use the insider release, and in the current version (1.3.0), vscode doesn't keep unsaved file. I think there is a feature request for that.
Got it: https://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/8568343-keep-unsaved-files-after-crash
You can vote for that feature, like I did !
On the other hand, You can tell in settings if you want to re-open previously opened folders, but not files.
"window.reopenFolders": "all"

Visual Studio 2012 strange characters at beginning of file

Whenever i copy a file made in VS2012 over to Eclipse, and open the file in Eclipse doc viewer there always seem to be some extra characters at the beginning (pic below). They arent visible in VS2012, or if I open the file in Notepad. What character is that being put there, and how can i get it to stop? Below is a pic of a JS file I made i VS, and how it appears in Eclipse
Thats a UTF8 BOM, Ive heard thgis works well for windows
http://www.bryntyounce.com/filebomdetector.htm
If you have access to linux you can use awk to remove