.yaml files are turning into .yml files when using "Save (a Copy) As..."
-
Part of my hobby involves using a .yaml file as a template to create other .yaml files for use within another program. The problem is that choosing “Save As…” or “Save a Copy As…” while keeping “Append extension” ticked will sometimes turn the resulting .yaml file into a .yml file, which the other program can’t read. You instead have to untick “Append extension” and then manually add the .yaml extension, or copy the file and rename it within the file explorer. It’s not a huge deal, but I’m confused why Notepad++ would automatically change the file extension of the copy (which it doesn’t do when you just press “Save”).
-
@L1N3R1D3R said in .yaml files are turning into .yml files when using "Save (a Copy) As...":
You instead have to untick “Append extension” and then manually add the .yaml extension,
… or you can just type the
.yaml
extension without unchecking that box. If there is an extension typed, “append extension” does not append a second extension.I’m confused why Notepad++ would automatically change the file extension of the copy
It doesn’t change the extension; when you do a Save As (or Save A Copy As), it’s creating a new file, and you aren’t “changing” the name (so it’s not “changing” the extension) – it’s giving it a brand new, first time name. For all new files of a given filetype, Notepad++ assumes that the first extension in the list – in this case
.yml
, is the one for automatic extension. The same is true for any language that has multiple extensions.But, as I said, all you have to do to override that default is to type your own extension, and Notepad++ will use it.
And if you want to change things so that your copy of Notepad++ always uses
.yaml
as the default for YAML files, instead of.yml
, you can close all instances of Notepad++, edit%AppData%\Notepad++\langs.xml
, change<Language name="yaml" ext="yml yaml" ...
to<Language name="yaml" ext="yaml ymml" ...
, save and exit, then restart Notepad++ – from then on,.yaml
will come before.yml
in the Save/SaveAs dialog for YAML files, and that will be the default extension for you.