Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Save as .md default

    Help wanted · · · – – – · · ·
    markdown
    4
    11
    215
    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.
    • Patrick Danilevici
      Patrick Danilevici last edited by

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

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @Patrick Danilevici last edited by

        @patrick-danilevici ,

        see this conversation from a couple days ago.

        Patrick Danilevici 1 Reply Last reply Reply Quote 0
        • Patrick Danilevici
          Patrick Danilevici @PeterJones last edited by

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

          PeterJones 2 Replies Last reply Reply Quote 0
          • PeterJones
            PeterJones @Patrick Danilevici last edited by

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

            mpheath 1 Reply Last reply Reply Quote 2
            • PeterJones
              PeterJones @Patrick Danilevici last edited by

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

              Patrick Danilevici 1 Reply Last reply Reply Quote 3
              • mpheath
                mpheath @PeterJones last edited by

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

                PeterJones Michael Vincent 2 Replies Last reply Reply Quote 3
                • PeterJones
                  PeterJones @mpheath last edited by

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

                  mpheath 1 Reply Last reply Reply Quote 3
                  • mpheath
                    mpheath @PeterJones last edited by mpheath

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

                    PeterJones 1 Reply Last reply Reply Quote 1
                    • PeterJones
                      PeterJones @mpheath last edited by

                      @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
                      • Michael Vincent
                        Michael Vincent @mpheath last edited by

                        @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
                        • Patrick Danilevici
                          Patrick Danilevici @PeterJones last edited by

                          @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
                          • First post
                            Last post
                          Copyright © 2014 NodeBB Forums | Contributors