Notepad++ "Projects" info



  • Hi, @dinkumoil,

    Very explicative post, especially the difference between Projects and Workspace. Many thanks for taking the time to explain these concepts ;-))

    BR

    guy038



  • It confuses things somewhat that in the “Project” area we have the concept of a “workspace”, and, totally different, we have the “Project as Workspace” feature.



  • @Alan-Kilborn ,

    Poorly named, maybe. But not “completely different”, IMO: the Folder as Workspace behaves like a single Project Panel with its workspace automatically defined, except it’s tied to the Windows filesystem hierarchy, rather than being fully customizable.
    (Personally, I think the “Project Panel” should be called “Workspace Panel”, since each “workspace” contains one or more “projects”. But at this late stage, I wouldn’t recommend renaming it.)

    Anyway, I did some offline work before I saw @dinkumoil’s description.

    My thought was that I’d expand the Sessions documentation to “Sessions, Workspaces, and Projects”. My rough draft follows:

    -----

    Sessions, Workspaces, and Projects

    There are three built-in “multiple file management” systems available natively in Notepad++.

    • Sessions = a set of files that can be opened with one action.
    • Folder as Workspace = a tree-based interface to easily access the files in a given Windows directory.
    • Project Panels = a tree-based interface to access related files that aren’t necessarily grouped in the same Windows directory structure.

    There are also various plugins available that might help manage sessions or workspaces, or serve similar purposes but with a different feature set compared to these built-in features.

    Sessions

    Sessions are a set of files to be opened in Notepad++. Using sessions, you can open a set of files with one action. They do not have to be in the same directory or even on the same drive.

    The session file stores the paths of the open files, the active file (and which view, see the section about Multi-View), the current selection and position in the file, the current bookmarks (see Bookmarks) and the current language (see the section about Languages). When you load the session, all of that information is loaded back into Notepad++.

    • File > Load Session… can be used to load an existing session.
    • File > Save Session… can be used to save the currently-open files as a session.

    Session files are XML, and are identical in format to the session.xml config file.
    The MISC preferences include an option to set a file extension that will automatically be opened equivalently to Load Session, even if you use File > Open to access that session; that extension will also be the default when you Save Session¹.

    You can also load a session file using the -openSession command line argument.

    Folder as Workspace

    This feature allows you to use a tree-based interface to easily access the files in a given directory. When you drag a folder from Windows Explorer onto Notepad++, this feature will be activated (unless overridden by the “… folder dropping” option).

    You can also load a folder as workspace session file using the -openFoldersAsWorkspace command line argument.

    If you right-click in the Folder as Workspace panel, you can add more directories to the current workspace.

    Double-clicking on a file from the tree-view will open it as a new tab in the Notepad++ editor (or will activate that tab if it’s already open). Closing the tab for a file from the project will not remove it from the Folder as Workspace panel, so it’s easy to re-open that file.

    Project Panels

    The project panels are similar to the Folder as Workspace panel, but allow you to organize the tree view to your liking, rather than being forced to follow the Windows filesystem hiearchy.

    Double-clicking on a file from the tree-view will open it as a new tab in the Notepad++ editor (or will activate that tab if it’s already open). Closing the tab for a file from the project will not remove it from the Folder as Workspace panel, so it’s easy to re-open that file.

    There are three Project Panels available from the View > Project sub-menu. The three Project Panels can be individually docked or floated.

    In each panel, you can open one Workspace file. Using the Workspace button on the Project Panel, or right clicking on the workspace’s name in the tree view, you can perform a variety of actions, enumerated below. The MISC preferences include an option to set a file extension that will automatically be opened equivalently to the Open Workspace command, even if you use File > Open to access that workspace file; that extension will also be the default when you Save Workspace¹.

    Each Workspace can house one or more Projects. Clicking the Edit button on the Project Panel, or right clicking on the project name, will give you administrative options for the selected Project, enumerated below. In each Project, you can select individual files or the contents of whole Windows Directories to be added to the project, and you can reorder the files. If you add a Folder to the Project, you are not creating a Windows Directory anywhere: you are creating a container inside the Notepad++ Project item; the files listed in a folder have not moved. To reiterate: Project Folders are independent of the filesystem, and are just hierarchical containers for this feature of Notepad++.

    You can move a file into a Folder by dragging the file. Other than that, there aren’t other drag-and-drop features in the Project Panel.

    For any entry in the Project Panel tree view, right clicking will give you the available actions on that specific entry.

    • On a Workspace:
      • New Workspace = close the existing Workspace (if one is open for this Project Panel) and create an empty Workspace for this Project Panel.
      • Open Workspace = close the existing Workspace (if one is open for this Project Panel) and open the selected Workspace file.
      • Reload Workspace = re-read the XML file for the active Workspace (it may have been edited externally).
      • Save = save any changes in the projects, files, and folders of the active Workspace configuration.
      • Save As = save the active Workspace in a new Windows filesystem location.
      • Save As Copy = save the active Workspace in a new Windows filesystem location, keeping the old workspace file as well.
      • Add New Project = add a new project container to the active Workspace.
    • On a Project entry:
      • Move Up / Move Down = reorder the selected Project relative to other Projects in the Workspace.
      • Rename = change the name of the Project.
      • Add Folder = create a new container to go in this Project.
      • Add Files = use a Windows Open dialog to select one or more files to add to the Project’s tree.
      • Add Files from Directory = add all the files from that Windows directory into the Project.
        • Please note: this is not a recursive action: this just puts all the files in the list.
        • Please note: this does not create a new Folder entry in your project.
        • If you want a feature that automatically maps to the selected Windows directories, use Folder as Workspace instead
    • On a Folder entry:
      • Has all the same actions as on the Project entry, but everything is relative to this Folder instead of relative to the Project.
    • On a File entry:
      • Move Up / Move Down = reorder the selected file relative to other files or Folders in the containing Project or Folder.
      • Rename = changes the name of the file in the list.
        • This action does not change the underlying file.
        • If the new name does not exist as a file, it will show a little error symbol on the file icon in the tree.
        • If the new name does exist as a file, the old file will still exist but will no longer be a part of this Project.
      • Remove = removes the file from the Project.
        • This action does not change the underlying file.
      • Modify File Path = similar to rename, changes the file in the list, but also allows you to change what Windows directory is being referenced.
        • This action does not change the underlying file.
        • If the new name does not exist as a file, it will show a little error symbol on the file icon in the tree.
        • If the new name does exist as a file, the old file will still exist but will no longer be a part of this Project.

    <hr>

    Footnotes

    <a name=“FN1”>¹</a>: if you set the Session or Workspace extensions, you will find it difficult to edit the XML for the given Session or Workspace file inside Notepad++. To do that, you can temporarily clear that preference setting, edit the file, then set the extension preference again.

    -----

    Let me know if you have comments or recommendations, or if you think I should incorporate more of @dinkumoil’s descriptions/phraseology.



  • I created a new branch in my npp-usermanual fork, so here is a link to the in-progress session.md source.

    Feel free to comment in issue#131 if you have more suggestions, or submit a PR to my fork/branch if you have specific changes that you think I should incorporate.

    (For future readers: if/when the changes from this branch are incorporated into the master repo, or are rejected, the branch will be deleted and the above link will not work)



  • Hello, @peterjones, @dinkumoil, @alan-kilborn and All,

    Personally, I would suggest that you insert, at the place you think most appropriate, the last part of the @Dinkumoil’s post, below, which clearly illustrates the fundamental difference between the two concepts of Projects and Folder as Workspace !

    Differences Between Projects and “Folder as Workspace”

    In contrast to the Folder as Workspace feature, projects are not bound to the content of a certain folder on the hard disk. Instead, it is possible to put together files and folders from various locations on the hard disk into one project. It is even possible to create folders in a project which actually don’t exist on the hard disk and add files from various locations to them. Long story short, with projects it is possible to combine files and folders into a totally virtual structure. This can speed up accessing files which are logically related to each other but are widely spread over the hard disk.

    Cheers,

    guy038



  • @PeterJones

    I haven’t experimented more with Projects, but reading your proposed documentation, I didn’t see the feature I’m most interested in.

    If I “join” a group of files from very different locations on my computer together via a project, I want to be able to search the project files for certain text items. I want to be able to search only these files.

    I really must experiment more myself before commenting further. :-)



  • @Alan-Kilborn said in Notepad++ "Projects" info:

    I didn’t see the feature I’m most interested in.

    I doubt what you described exists. But since Scott “likes” implementing search features, it would be worth putting in the feature request for a “Search in Project Files” option.



  • @PeterJones said in Notepad++ "Projects" info:

    it would be worth putting in the feature request for a “Search in Project Files” option.

    It seems the github link I provided before suffices for this, if it could be resurrected somehow.

    I notice even “Folder as Workspace” has the ability to do searches (right-click a folder in that view, there’s a Find in Files… option).

    Curious, though, what other advantages a “project” brings over using Explorer plugin and its favorites feature. Maybe “project” satisfies some requests for “pinning” files without using a plugin.

    Not real questions, though, as I’ll be finding out. If I find interesting things, I’ll report back here.



  • So in advance of what looks like some activity on github for an addition of a “search in project” capability, I started some renewed experimenting with “projects”.

    It seemed to go well. :-)

    One thing I noticed: There’s an ability to rename a file in the project window. Normally a file just has the same name (without path) in the project window that it has on disk. I renamed a file to try this out, and it accepted my new name, but I don’t know what good it does, as double-clicking the new name doesn’t open the original file into N++ tab set. Additionally, in the project window it put a little - in a red circle as the file’s icon:

    83758465-bd9b-4119-89d2-dd747930c29f-image.png

    Am I just missing the point of this type of renaming?
    My original file had a cryptic name that I thought I could give a better “mnemonic” name to in the project view, obviously retaining the actual name on disk–because that is needed for other tools in the tools that handle the project–third-party tools, not N++'s tools.

    Ah, I see in the “hover” tip that it thinks the file is at a path that reflects the new name I gave it. But there is nothing there (because it doesn’t actually rename the disk file); that’s why double-clicking it does nothing – but I’m still a bit confused about this.



  • Looks like changing name in file item changes also it path. This not happend when we rename folder item. For me it looks like a bug, both the name for folder/file item in list is just a label (which can be changed) but the real source should be indicated by path.


Log in to reply