Option to Auto-Append Extension Type to a File for "Save As"

Post Reply
Cr8zy_Ivan
Posts: 3
Joined: 24.09.2025 22:32

Option to Auto-Append Extension Type to a File for "Save As"

Post by Cr8zy_Ivan »

Hello, I'm looking for a way for newly created files to be auto-saved with a predefined extension. In my case, it is ".cfg".

When I open a new blank tab and then "Save As", I want my file to be saved with a specific extension type, if I write it out in the textbox. As an example, I could write out "Test-File-001.json" and the file would be named like this. If I DON'T specify an extension type I want the file extension to automatically be ".cfg". In this second use-case, I would simply write out "Test-File-001" (without an extension type) and CudaText would save my file as "Test-File-001.cfg".

There was a way to do it with Notepad++ but I can't remember if it was an option in Notepad++ itself or if it was a Plugin that allowed users to do it.

I've looked in the config and I've looked for Plugins but I haven't found anything.

Does anyone know if this is something that can be done in CudaText?

Thanks!
main Alexey
Posts: 2637
Joined: 25.08.2021 18:15

Re: Option to Auto-Append Extension Type to a File for "Save As"

Post by main Alexey »

I experimented with an empty lexer with only file-extension 'cfg' set in it.
create file Cfg.lcf in the folder data/lexlib:

Code: Select all

object SyntAnal21: TLibSyntAnalyzer
  Extentions = 'cfg'
  LexerName = 'Cfg'
end
then set the option in user.json:

Code: Select all

  "newdoc_lexer": "Cfg",
now if I save new doc as 'new' it saves file 'new.cfg'.
Cr8zy_Ivan
Posts: 3
Joined: 24.09.2025 22:32

Re: Option to Auto-Append Extension Type to a File for "Save As"

Post by Cr8zy_Ivan »

Well hot dang! That worked on the first try! CudaText = Very Cool ➔ ✔Check
main Alexey
Posts: 2637
Joined: 25.08.2021 18:15

Re: Option to Auto-Append Extension Type to a File for "Save As"

Post by main Alexey »

Thank you, now let's advertise the editor on blogs/forums. :)
Cr8zy_Ivan
Posts: 3
Joined: 24.09.2025 22:32

Re: Option to Auto-Append Extension Type to a File for "Save As"

Post by Cr8zy_Ivan »

Oh! I forgot to say: Thank you!

And: 👍 for advertising.
main Alexey
Posts: 2637
Joined: 25.08.2021 18:15

Re: Option to Auto-Append Extension Type to a File for "Save As"

Post by main Alexey »

I mean, if you can help to spread the word, ie advertise the program, it will be good.
Post Reply