Save as .md default
-
Is any way to have default files as
.md
instead ofNormal text
? -
see this conversation from a couple days ago.
-
@peterjones way to complicate. Hope Notepad++ will came with
.md
extension inSave as...
menu. -
Since markdown is handled by UDL rather than a built-in lexer, that’s the way it’s got to be, because there are a nearly unlimited number of possible file types available to UDL, and Notepad++ cannot possibly translate every possible one into the hardcoded SaveAs menu.
OTOH, just choosing “All Types” and typing .md after the file name isn’t that onerous.
-
I previously said,
hardcoded SaveAs menu.
Good news: there is at least a workaround in the Save As menu. It turns out that wasn’t as hardcoded as I thought.
If you go to
%AppData%\Notepad++\langs.xml
, and edit it (following config-file-editing recommendations), adding<Language name="Fake" ext="fak fake false"/>
… then save and restart, then File > Save As gets a new entry:
It’s poorly named as “Normal text file” again, but it has a different list of extensions (and the original “Normal text file (*.txt)” at the beginning is still there, so you lose nothing).
By my experimentation, where you put that line in
langs.xml
will determine where in the SaveAs list it goes, so if you use it often, put it near the top. For example, if I move it from the end of the list to right after the normal “Normal”:<Languages> <Language name="normal" ext="txt"/> <Language name="Fake" ext="fak fake false"/> ...
… then it will go right after the normal-“Normal” in the list:
So you would miss the name of the UDL in the Save As list, but that would at least have that extension list, and when you select that new entry, it will default to
.fak
appended to your filename. If you have your UDL set up to be automatically associated with.fak
(that is, the user extensions box in the UDL setup shows asfak fake false
to match mylangs.xml
entry), then once you save the file assomething.fak
, Notepad++ immediately changes the selected Langauge to your UDL.Unfortunately, that doesn’t put it in the Settings > Preferences > New Document > Default language group, but it is a step in the right direction.
-
@peterjones said in Save as .md default:
Since markdown is handled by UDL rather than a built-in lexer, that’s the way it’s got to be, because there are a nearly unlimited number of possible file types available to UDL, and Notepad++ cannot possibly translate every possible one into the hardcoded SaveAs menu.
That is unfortunate to use UDL for Markdown when it has been built-in to Scintilla\Lexilla since 2010. The commit history of LexMarkdown.cxx. It may have been provisional earlier though it is used by SciTE, Geany…, so perhaps Notepad++ could use the built-in Markdown lexer soon in an update.
-
@mpheath said in Save as .md default:
That is unfortunate to use UDL for Markdown when it has been built-in to Scintilla\Lexilla since 2010
What, really?! Checking… Yep. Wow! That surprises me. I had always assumed that the reason that they added the Markdown UDL was that Scintilla had for some reason overlooked Markdown.
I just submitted issue #11099 to ask if they could switch from UDL-Markdown to LexMarkdown, or at least make it user-configurable.
And yesterday, I had submitted #11096 Allow UDLs in SaveAs and #11097 Allow UDLs in Default Language, based on earlier comments in this discussion.
I cannot guarantee that anything will happen as a result of those issues, but they’ve at least been submitted. And anyone reading this discussion who agrees that one or more of those is a good idea is free to go upvote or comment.
-
@peterjones said in Save as .md default:
I just submitted issue #11099 to ask if they could switch from UDL-Markdown to LexMarkdown, or at least make it user-configurable.
I gave your feature request a thumbs up. If it gets added, then it can get the full theming options, dark mode compatibility, *.md in save as dialog perhaps and more just like the other built-in languages. :)
-
@mpheath said in Save as .md default:
If it gets added
Based on the discussion that followed, it appears that the developer found LexMarkdown to be buggy, hence the decision to stick with UDL for Markdown.
Hopefully the other two feature-requests will gain traction, because that at least makes it easier to default to a UDL or easily save-as to a UDL.
-
@mpheath said in Save as .md default:
That is unfortunate to use UDL for Markdown when it has been built-in to Scintilla\Lexilla since 2010. The commit history of LexMarkdown.cxx.
This has been discussed on this forum previously.
Cheers.
-
@peterjones said in Save as .md default:
I previously said,
hardcoded SaveAs menu.
Good news: there is at least a workaround in the Save As menu. It turns out that wasn’t as hardcoded as I thought.
If you go to
%AppData%\Notepad++\langs.xml
, and edit it (following config-file-editing recommendations), adding<Language name="Fake" ext="fak fake false"/>
… then save and restart, then File > Save As gets a new entry:
Excellent! Thanks a lot!