Clipboard Uses
From notepad-plus
Anyone who has been using a text editor know that one can copy some piece of text to the clipbaord, for the purpose of pasting it somewhere ele, possibly in several places. Even if you are using a clipboard manager, or the MultiClipboard plugin, thre is, at any given time, one piece of text in the clipboard.
Notepad++ offers some advanced ways to copy such text. Also, a number of functions use the clipboard text as parameter for their operation.
Contents |
Getting text to the clipboard
| Name | Default shortcut | Menu or plugin | Description |
|---|---|---|---|
| Copy | Ctrl+C | Edit menu | The clipboard text is set to the selection |
| Cut | Ctrl+X | Edit menu | The clipboard text is set to the selection. The selection is deleted. |
| Current full file path to Clipboard | <None> | Edit → Copy to Clipboard | Copy the fully qualified file name for current ocument |
| Current file name to Clipboard | <None> | Edit → Copy to Clipboard | Copy the base file name for current ocument, without its path |
| Current file path to Clipboard | <None> | Edit → Copy to Clipboard | Copy the path for current ocument, without the file base name |
| SCI_LINECOPY | Ctrl+Shift+T | Scintilla commands | Sets clipboard contents to the current line |
| SCI_LINECUT | Ctrl+L | Scintilla commands | Sets clipboard contents to the current line. The line is deleted |
| Copy bookmarked lines | <None> | Search menu | Copies the text of all bookmarked lines, including the line separators |
| Cut bookmarked lines | <None> | Search menu | Copies the text of all bookmarked lines, including the line separators. The lines are deleted |
| Copy Visible Selection | <None> | TextFX Viz | When lines have been hidden in a selection, only copy the visible lines |
| Cut Visible Selection | <None> | TextFX Viz | When lines have been hidden in a selection, only copy the visible lines. The lines get deleted |
| Copy Invisible Selection | <None> | TextFX Viz | When lines have been hidden in a selection, only copy the invisible lines |
| Cut Invisible Selection | <None> | TextFX Viz | When lines have been hidden in a selection, only copy the invisible lines. The lines get deleted |
| Copy Entire Selection (no append) | <None> | TextFX Viz | Copy all the lines in selection, including those being hidden |
| Cut Entire Selection (no append) | <None> | TextFX Viz | Copy all the lines in selection, including those being hidden. All the lines are deleted |
| Copy & Append Entire Selection | <None> | TextFX Viz | Copy all the lines in selection, including those being hidden, and append them to clipboard contents |
| Cut & Append Entire Selection | <None> | TextFX Viz | Copy all the lines in selection, including those being hidden, and append them to clipboard contents. All the lines are deleted |
The invisible lines of a selection comprise those hidden with the Hide lines command on the View menu.
It should be emphasized that, even though it is styled and clickable, the text in the Search results window is plain text. Copying and pasting it to a new file allows advanced processing of the search results.
For the TextFX commands to work, the Capture Keyboard Ctrl+X,C,V option in TextFX Viz Settings must be checked. Notepad++ needs being restarted for the change to take effect. Do not do this when you need to translate Unicode to UTF8, as Scintilla can do it, but not TextFX.
TextFX specific options
You can tweak cutting and pasting using a few options from the TextFX Viz Settings menu - you can always map them to some shortcut:
- Copy/Cut Appends to clipboard
- Copy/Cut always converts to CRLF
- Copy/Cut replaces [NUL] with space
- Copy/Cut also in UTF8
- Copy/Cut not in UNICODE
Use the latter two options to copy/cut and paste text to applications which are not compatible. Windows doesn't translate UTF8 to Unicode natively.
Pasting
There are much fewer commands to paste text:
- Edit -> Pasteinserts te text at the caret position, and make that text selected. Standard shortcut is Ctrl+V.
- Search -> Paste (Replace) bookmarked lines: Replaces all bookmarked lines with clipboard contents
- Edit -> Clipboard History... displays a dockable window listing clipboard snippets in text format. The text contents of the clipboard are loaded there on startup if available, and everything copied within Notepad++ is added as separate snippets. Double clicking a snippet pastes it.
- TextFX Viz -> Paste UTF8/ANSI:
- TextFX Viz -> Paste: the enhanced paste command. Paste The paste keyboard shortcut is redirected here when Ctrl+X,C,V are handled by TextFX (the Edit menu paste remains the original one).
Note that the Scintilla command does not support pasting of objects (spreadsheets) or images. You cannot even drag and drop text from another text editor.
Text FX specific options
- Paste retains position
- Paste/Append binary. Does not work on rectangular selections. Use under Windows 9x series could prove awkward - see documentation.
- Paste converts EOL to editor
Using the clipboard text as a parameter
A few TextFX commands use this scheme:
| Name | Submenu | Description | Nature/range of clipboard text |
|---|---|---|---|
| Insert (Clipboard) through lines | Edit | Inserts text in all selected lines, possibly at the column starting selection | The # sign is interpreted as a counter. $ brackets detrmines an offset relative to end of line. The counter increments by 1 or in a way further specified in text. |
| Strip unquoted text (VB) separated by (Clipboard<=20) | Edit | Isolates strings in the selection/document | Separator. If more than 20 character long, a comma will be used |
| Strip unquoted text (C) separated by (Clipboard<=20) | Edit | Isolates strings in the selection/document | Separator. If more than 20 character long, a comma will be used |
| Split line at (clipboard character) or , (VB) | Edit | Splits lline at the first separated found in unquoted text | Separator, or , if not a single character |
| Split line at (clipboard character) or , (C) | Edit | Splits lline at the first separated found in unquoted text | Separator, or , if not a single character |
| Line up multiple lines by (Clipboard Character) | Edit | The farthest position of the first occurrence of the separator in each line is determined, and all such instances are pushed right to align on that farthest position | The single character to align on |
| Rewrap text to (Clipboard or 72) width | Edit | Wraps line at width specified by clipboard contents, 72 if not usable | A number between 8 and 2048. If something follows the integer, it is ignord |
| Hide lines with (Clipboard) text | Viz | Searches eah line in selection for the text, and hide the lines when found, adding to any existing show/hide sequence. | None |
| Hide lines without (Clipboard) text | Viz | Searches eah line in selection for the text, and hide the lines when not found, adding to any existing show/hide sequence. | None |
| Show lines with (Clipboard) text | Viz | Searches eah line in selection/document for the text, and shows the line when found, adding to any existing show/hide sequence. | None |
| Show lines without (Clipboard) text | Viz | Searches eah line in selection/document for the text, and shows the line when not found, adding to any existing show/hide sequence. | None |
Insert through lines variable text
If the clipboard text has a # sign, this is interpreted as a counter. You can specify its initial value (0 by defaault) and increment (1 by default) immediately after the #. Thus, #-5-2 is a counter that evaluates to -5 on the first afected line, -7 on the second line and so on. You can have multiple counters.
A $<spec>$ prefix to the text instructs putting at some offset (0 by default) from end of line. When offset is greater than 0, spaces are added. When line is too short, it is skipped. Without such a prefix, the starting column of the selection is the insertion point on each line. You cannot use # to specify a variable increment inside the $'s.
To insert exactly at end of line, you can shorten $$ to $. You should not do so if the text contains a $ sign, because of the obvious ambiguity.
