• Login
Community
  • Login

Save as .md default

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
markdown
11 Posts 4 Posters 4.7k 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.
  • P
    Patrick Danilevici
    last edited by Jan 27, 2022, 6:30 PM

    Is any way to have default files as .md instead of Normal text?

    P 1 Reply Last reply Jan 27, 2022, 6:32 PM Reply Quote 0
    • P
      PeterJones @Patrick Danilevici
      last edited by Jan 27, 2022, 6:32 PM

      @patrick-danilevici ,

      see this conversation from a couple days ago.

      P 1 Reply Last reply Jan 27, 2022, 6:39 PM Reply Quote 0
      • P
        Patrick Danilevici @PeterJones
        last edited by Jan 27, 2022, 6:39 PM

        @peterjones way to complicate. Hope Notepad++ will came with .md extension in Save as... menu.

        P 2 Replies Last reply Jan 27, 2022, 6:46 PM Reply Quote 0
        • P
          PeterJones @Patrick Danilevici
          last edited by Jan 27, 2022, 6:46 PM

          @patrick-danilevici ,

          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.

          M 1 Reply Last reply Jan 28, 2022, 1:44 PM Reply Quote 2
          • P
            PeterJones @Patrick Danilevici
            last edited by Jan 27, 2022, 7:36 PM

            @patrick-danilevici ,

            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:
            b460b6af-85bc-42d4-9302-6a53b3b677fd-image.png

            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:
            a9d5a099-002d-41d8-86bd-324e8fb6f1da-image.png

            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 as fak fake false to match my langs.xml entry), then once you save the file as something.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.

            P 1 Reply Last reply Feb 1, 2022, 5:13 PM Reply Quote 3
            • M
              mpheath @PeterJones
              last edited by Jan 28, 2022, 1:44 PM

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

              P M 2 Replies Last reply Jan 28, 2022, 2:26 PM Reply Quote 3
              • P
                PeterJones @mpheath
                last edited by Jan 28, 2022, 2:26 PM

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

                M 1 Reply Last reply Jan 28, 2022, 2:39 PM Reply Quote 3
                • M
                  mpheath @PeterJones
                  last edited by mpheath Jan 28, 2022, 2:40 PM Jan 28, 2022, 2:39 PM

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

                  P 1 Reply Last reply Jan 28, 2022, 3:22 PM Reply Quote 1
                  • P
                    PeterJones @mpheath
                    last edited by Jan 28, 2022, 3:22 PM

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

                    1 Reply Last reply Reply Quote 1
                    • M
                      Michael Vincent @mpheath
                      last edited by Jan 28, 2022, 8:33 PM

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

                      1 Reply Last reply Reply Quote 2
                      • P
                        Patrick Danilevici @PeterJones
                        last edited by Feb 1, 2022, 5:13 PM

                        @peterjones said in Save as .md default:

                        @patrick-danilevici ,

                        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:
                        b460b6af-85bc-42d4-9302-6a53b3b677fd-image.png

                        Excellent! Thanks a lot!

                        1 Reply Last reply Reply Quote 0
                        8 out of 11
                        • First post
                          8/11
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors