1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Document Management

From notepad-plus

Revision as of 13:35, 28 May 2012 by Cchris (Talk | contribs)
Jump to: navigation, search
Juggling with files, documents and views


Notepad++ is a multidocument editor. You can have several tabs (the technical term is "buffers") pointing at different positions of a same file, with editing on one tab being reflected on the other when some viewing windows overlap.

While Notepad++ offers the expected file and document management commands found on any editor, it can go further, owing in part to its plugin set.

Contents

Creating, loading and saving files

New documents

New documents are created from File -> New, and have a name like new#, where # is an autoincrementing number starting at 1 if no other file is loaded, else 2. Double clicking in some free space on the tab bar, assuming it is not in multiline mode, has the same effect - it won't work in multiview mode as of 6.5.5.

The encoding and format default options are set in Settings -> Preferences -> New Document / Default Directory tab, as well as the highlighter used initially. Note that the uper ANSI button means OEM-US. For other ANSI encodings, use the Encoding button: checking it activates a list to choose the desired code page from.

Use the Language menu to change the default highlighter as needed, or save the document with an extension that will trigger the desired highlighter.

Loading files

This is basically done using the File -> Open command. What folder will come up in the Open file dialog is controlled from the Settings -> Preferences -> New Document / Default Directory -> Default Directory (Open/Save) frame at the bottom. There you choose between three behaviours:

  • Open the directory containing the current document
  • Remember last operation directory (this is shared with file saves)
  • Use a fixed folder for both loads and saves. Selecting this radio button enables a text field to acquire that folder.

Notepad++ will notice it when you attempt to open more than 200 files, and display a warning in case this was not intended.

The Recent files list

Opening a file can be efficiently done using the recent file facility. You enable it from Settings -> Preferences -> New Document / Default Directory -> Recent File History frame by setting the number of files to remember to a nonzero value - numbers above 30 will be trimmed down to 30. A checkbox toggles whether you want the existence of these files checked at startup.

The Display subframe controls the appearance of the list. You can choose having the files shown straight in the Files menu or in a submenu thereof. Also, you can choose whether fully qualified, unquaified or qualified, truncated names are shown. In the latter case, clicking the number on the right will enable you to choose how many character wide the qualified file name will be at most. This only shows if you click the bottom-most radio button, as the setting is otherwise ignored.

Sessions

You can also load files usng the File -> Load Session command. This enables full fledged Project Management. Notepad++, if instructed to do so by checking Settings -> Preferences -> MISC -> Remember the current session for next launch, will load session.xml at startup as a session, unless is is launched with the -nosession switch. The switch disables both startup loading and shutdown recording.

More methods

You can open a file by selecting its name and using either of open file or open in a new instance commands from the Run menu. And remember that these can be added to an tweaked at will using Run -> Run... or editing shortcuts.xml.

The files that contain a hit from an earlier Find in files action can be opened simultaneously. This is available as a right click menu entry for the Search results window, since v5.5.1. If several search operations are visible in the window, all the files they involved are opened.

Sometimes, while working on a file, you'll want to zap all edits since the last save and start afresh. This is done through the File -> Reload from Disk command.

Finally, you can open files into Notepad++ by dragging one or more file or folders onto the desktop shortcut to Notepad++. As of v6.5.5, links will open as normal files instead of their target file.

Saving files or documents

You can plainly File -> Save the current state of a file, clobbering its former state. This may be desirable, or very damaging if you made a mistake and are not sure how to revert it. You can compound the benefits or damage by a File -> Save All command to act upon all opened documents in both views. The Save and Save All buttons are disabled if there is no modification to save in current/any opened document.

For more control, you need to save successive versions of a file. There are several ways to do that:

  • File -> Save As. You are prompted for a new file name. The current state of the document is saved to this new name - which may be an old file -, and this new name becomes the current working copy of the document. If you have two buffers pointing at one file, and Save As one of them only, you can keep working on both branches of the fork. Have fun. The probability for something to get lost in the process vastly increases then. Most competing text editors only have this option.
  • File -> Save a Copy As. This is often more convenient. You are still prompted for a new name for the current document, but the old name remains the working copy. This effectively creates successive versions of a file while working on the head revision. Any likeness with file version control systems is definitely intended.
  • Using backups. They can be configured from the Settings -> Preferences -> Backup / Autocompletion tab. While you can specify a fixed folder for the backed up files (otherwise they are in the same folder as the original), they don't have a configurable extension. Files are backed up when saved and modified. Choosing verbose backup mode allows for a timestamp to be inserted in the full name of the backed up copy.
    See the AutoSave plugin for an alternative way using timed backups.
  • Using a version control system. It is not necessary to be collaborating on shared code to use SCM (Source Code Management, also known as Revision Control). It is recommended for any project in which you may want to review changes made to files. Through proper configuration, you can make your machine the repository for your files, no network needed. It is also easy to set up a SCM server in order for you to work on your files from any location. To access the SCM functionality from inside Notepad++, there are three ways at least:
    • Use Run commands to send commands to external programs through their command line
    • Most SCMs integrate with Windows, so that, through the Explorer or Light Explorer plugins, you can invoke the functionality through a right click;
    • Use the Subversion plugin, which is barebones but functional in its v1.2 form.

In addition, the Save As command is available from the tab right click menu, which is not configurable.

Saved files automatically receive an extension if they don't have one. End a filename with a period to disable this feature. The extension is the preferred extension for the lexer being in use at the time of save - for Normal text, it is .txt.

Closing files

Any file which is detected as possibly modified will trigger a message box asking whether it is to be saved.

You can either close the current document, all documents but the current one, or all documents. The first two options are available from the tab bar menu as well. Middle-clicking the tab will also close the tab.

File -> Close All acts on both views, leaving Notepad++ with one empty new tab. Of course, File -> Exit also closes the application.

Using File -> Save As implicitly saves and closes the current file, the new file becoming the working copy.

Depending on your Tab Bar options, you may have more ways to close the current tab.

For unsaved documents, Save will defer to Save As. When saving files using the Normal highlighter, and which do not have an extension, a default of ".txt" is provided in the save file dialog box.

Other file operations

You can {File -> Rename a adocument (also from tab bar menu). This is very useful in the are cases it is needed.

File -> Delete from disk -> {{{2}}} asks whether to save the document, closes it and deletes the file. Useful when you make experiments and they involve saving the file, but then you call it quits.

Document management

Commands related with enabling Multiple Views xill not be covered here.

Switching between documents is achieved in a number of ways:

  • Clicking on the tab of the document
  • Using Ctrl+Tab to move to the next document, Ctrl+Shift+Tab to previous (in tab order). Change the order of tabs by dragging them. This will drag a whole row of tab when the tab bar is in Multi-line mode.
  • Using the ontegrated Window -> Windows... facility, described in greater detail below.
  • Using extension plugins like Window Manager or File Switcher
  • Right clicking on some tab and moving the mouse wheel. A sort of pop up menu appears, the name of the clicked document being in bold. You can keep using the mouse wheel to cycle through this menu.

Image:Tabswitch.png

The native window manager

Image:WinMgr.png

This shows all opened documents in the current view. The column headers headers are clickable in order to sort the list by name, path or type (only for built-in types as of v6.5.5).

Selecting one or more document(s) allows saving or closing them all. Selecting a single document also allows activating it.

The documents are initially listed as if reading the tab bar left to right and top to bottom. If a sorting action was performed, the Sort tabs button becomes active; clicking on it will reorder the tabs according to the new list ordering.

If the window is still open, the Ok button will dismiss it as well as hitting Esc or clicking the cross in the upper right corner.

The Vertical File Switcher

Image:VFS.png Since the Windows window doesn't remain open at all times, another windowed view of the files being opened is provided. This is a dockable window with document names from both views, left view above right view. Clicking an item makes the corresponding tab active. Right-clicking an item pops its tab context menu up. So it is really a vertical, moveable tab bar for most practical purposes. Clicking on the Name header sorts the lists, but not the tabs. Also, tab names from both views are mixed upon sorting. While there is no Unsort command to recover view partitioning, closing and reopening N++ will rever to unsorted mode.

Its state is recorded on normal shitdown like any dockabe window. To toggle it on/off, use the check box on the Settings -> Preferences -> General -> Document Switcher, right above the tab bar option frame. Of course it closes using its own cross button as well.

Documents, views and instances

The View -> Move/Clone current document submenu has four commands:

  • Move to other view
  • Clone to other view
  • Move to other instance
  • Open in new instance

These commands are also available in the tab bar menu.

This looks flexible enough, but you cannot clone to another existing instance. Right?

Right, but wrong.

Besides these commands, you can drag and (Ctrl+)drop tabs. As expected, dragging moves and Ctrl+dropping clones. This enables to distribute documents across running instances freely, reorder tabs in an instance, and open new instance when (Ctrl+)dropping outside any instance of Notepad++.

And, since tab visibility is of importance in such a visual user interface, the right half of the Settings -> Preferences -> Global tab is devoted to their appearance Some colours are configurable from Settings -> Styler Configurator -> Global Styles , Default Style - look for style elements like "Active tab ..." or "Inactive tab".

Personal tools
INVISIBLE