Community
    • Login

    .yaml files are turning into .yml files when using "Save (a Copy) As..."

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      L1N3R1D3R
      last edited by

      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”).

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @L1N3R1D3R
        last edited by

        @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.

        0f0641aa-0da0-4000-8f85-13abd08c248d-image.png

        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.

        1 Reply Last reply Reply Quote 4
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors