Community

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

    How could one sort the files in the "Recent Files" menu in "Files" by date / last closed or alphabet?

    General Discussion
    3
    5
    214
    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.
    • Cletos
      Cletos last edited by

      How could one sort the files in the “Recent Files” menu in “Files” by date / last closed or alphabet?

      dinkumoil 1 Reply Last reply Reply Quote 0
      • dinkumoil
        dinkumoil @Cletos last edited by

        @Cletos

        • Sorting of the recent files list by “last closed” order would require changes to the Notepad++ code base, thus you should file a feature request in the issue tracker. Read this help desk entry to learn how to do that.
        • Sorting the list by file date would require scripting. Since this is not a scripting forum you should look for support at another website.
        • Alphabetical sorting of the recent files list can be done with the help of the following XSLT code:
        <?xml version="1.0" encoding="Windows-1252"?>
        
        <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        
          <xsl:output
            method="xml"
            encoding="Windows-1252"
            indent="yes"
            omit-xml-declaration="no"
          />
        
          <xsl:template match="@*|node()">
            <xsl:copy>
              <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
          </xsl:template>
        
          <xsl:template match="/NotepadPlus/History">
            <xsl:copy>
              <xsl:copy-of select="@*"/>
              <xsl:apply-templates select="File">
                <xsl:sort select="@filename"/>
              </xsl:apply-templates>
            </xsl:copy>
          </xsl:template>
        
        </xsl:transform>
        

        To apply that code on the Notepad++ settings file you need msxsl.exe, a command line XSLT processor released by Microsoft. You can download it >>> here <<< or just google for msxsl.exe.

        With the following commands executed from a console window you can sort the recent files list:

        ren "%AppData%\Notepad++\config.xml" "config_backup.xml"
        msxsl "%AppData%\Notepad++\config_backup.xml" "<Path-to-file-with-above-XSLT-code>" -o "%AppData%\Notepad++\config.xml"
        

        Please note:

        • Run these commands only when there is no running instance of Notepad++.
        • The commands assume you use an installed version of Notepad++. If you use a portable version you have to adjust the path to the file config.xml.
        • The commands back up your original config.xml to a file named config_backup.xml in its original location, thus you won’t loose your original file.
        Alan Kilborn 1 Reply Last reply Reply Quote 2
        • Alan Kilborn
          Alan Kilborn @dinkumoil last edited by

          @dinkumoil said in How could one sort the files in the "Recent Files" menu in "Files" by date / last closed or alphabet?:

          Sorting of the recent files list by “last closed” order would require changes to the Notepad++ code base,

          Isn’t the list already in “last closed” order? Maybe I’m missing something, or I don’t understand the meaning of “last closed”.

          dinkumoil 1 Reply Last reply Reply Quote 4
          • dinkumoil
            dinkumoil @Alan Kilborn last edited by

            @Alan-Kilborn said in How could one sort the files in the "Recent Files" menu in "Files" by date / last closed or alphabet?:

            Isn’t the list already in “last closed” order?

            You are right, it is. The last closed file is the top one. Never noticed that as I normally work with so much different files that the “Recent Files” list is mostly useless for me.

            1 Reply Last reply Reply Quote 3
            • Cletos
              Cletos last edited by

              Many thanks, dinkumoil,

              for the instructions, very easily done. Works great! Many thanks again!

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              Copyright © 2014 NodeBB Forums | Contributors