Community
    • Login

    Set current directory to default if no real file is open

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 44 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.
    • fml2F
      fml2
      last edited by

      Hello,

      the setting “Default Directory > Default Open/Save file Directory” is set to “Follow current document” in my instance of NP++.

      Now, if I have some tabs with existing files and some other tabs that never have existed as a file (new and never saved), and I close the last tab with the “real” file, the current directory points to the directory of that last real file.

      Is it possible to change it to some other value after the last “real file tab” has been closed?

      Thank you!

      1 Reply Last reply Reply Quote 0
      • fml2F
        fml2
        last edited by fml2

        I’d like to explain the rationale behind the question.

        When I start NP++, the current folder is set to “Desktop”. This is the basic setup. The files I’m usually editing are not far from there.

        Sometimes, however, I edit files from other directories, maybe network ones. When I close the last such file I want the situation to return back to the basic setup. So that e.g. when I bring up the Open File dialog (Ctrl+O) it shows me the Desktop.

        PeterJonesP 1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @fml2
          last edited by

          @fml2 ,

          There isn’t a hybrid mode. The Default Directory settings are described in the User Manual. Either it always follows the current document (or most recent real document), or it always uses the directory of the last Open or Save action, or it always goes to the static default directory.

          As a workaround, you could use the Run menu:

          • Run > Run cmd /c "echo "%USERPROFILE%\Documents" | clip"
          • Save…, assign a name (DocumentsToClipboard or whatever) and a keyboard shortcut

          This would put DocumentsToClipboard in the Run menu (and that shortcut), so anytime you’re about to go from a “new” file, you could use that menu action or shortcut, then when you Save, you can paste in that value. It’s not exactly what you want, but it saves you having to navigate there yourself. (And, obviously, if your Documents folder weren’t where you wanted the destination, put that directory in rather than Documents before you initially Save the Run action)

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