Skip to content

Commit 0335e51

Browse files
authored
Merge pull request #336 from pryrt/sciShortcuts
Editing: Scintilla commands / shortcuts
2 parents 39148da + 9fc171d commit 0335e51

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

content/docs/editing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,13 @@ Aside from the normal undo/redo/copy/paste entries, there are a number of sub-me
113113
* If you use the OS to set the flag on a file that is open in Notepad++, and [**Settings > Preferences > MISC > File Status Auto-Detection**](../preferences/#misc) has been enabled, then Notepad++ will notice that it is now a read-only file, and not allow you to edit the file.
114114
* If you use the OS to set the flag on a file that is open in Notepad++, but [**Settings > Preferences > MISC > File Status Auto-Detection**](../preferences/#misc) has been disabled, then Notepad++ will _not_ notice that it was changed to read-only by the OS, and will blindly allow you to continue making changes; however, when you try to save and it sees that the file is read-only according to the OS, Notepad++ will notify you that you cannot save, and ask if you'd like to launch Notepad++ in Administrator mode to try to make the changes (if you do, the changes you made may be lost).
115115
* The current file's tab will have the "locked" icon (either the greyed-out disk icon by default, or the padlock icon if [**Settings > Preferences > General > ☑ Alternate icons**](../preferences/#general) has been checked on) whether the Windows OS read-only attribute is set, or the Notepad++ read-only flag has been set, or both. The "locked" icon will change to a normal icon once neither the Windows OS read-only attribute nor the Notepad++ read-only flag are set (or equivalently, once both flags are cleared).
116+
117+
## Other Editing Commands and Shortcuts
118+
119+
There are also around a hundred editor commands that are accessible from keyboard shortcuts (though not all have a keyboard shortcut assigned by default). Many of those commands are _not_ in the **Edit** menu (or any other Notepad++ menu). These commands are listed in the [**Shortcut Mapper**](../preferences/#shortcut-mapper)'s **Scintilla commands** tab, and you can use the **Shortcut Mapper** to edit the assignments (add shortcuts or remove shortcuts) for these commands, whether they currently have a shortcut or not.
120+
121+
They have somewhat cryptic names, but if you look at the portion of the name to the right of the `SCI_` prefix, it does give you a hint. For example, `SCI_CUT` shows the shortcuts for the traditional Cut command, and `SCI_LINECUT` will cut the whole current line, rather than just the selection. The ones that have `LINE` in the name work on complete lines; if it has `CHAR` in the name, it works on individual characters; if it has `WORD` in the name, it works on whole words; and if it has `WORDPART` in the name, it works on partial words (also called "subwords", like `MyCoolFunction` has the three subwords `My`, `Cool`, and `Function`); if it has `PARA` in the name, it works on paragraphs (a paragraph ends with two consecutive newlines -- so a blank line between paragraphs); `HOME`, `END`, `PAGEUP`, and `PAGEDOWN` correspond to the motions often associated with those keys on your keyboard. If it has `CUT`, `COPY`, `PASTE`, and `SELECT` in the name, it indicates a variant of the normal editor actions of cutting, copying, pasting, and selecting text; if it has `DELETE` or `DEL` in the name, it will delete what is indicated in the rest of the name; if it has `EXTEND` in the name, it "extends" the selection (adds to the selection; these are usually the `Shift+`-modified commands for growing the selection). That should be enough to help you understand the basics of what each of those commands do.
122+
123+
The Scintilla project, which Notepad++ uses to implement these traditional editor commands, has [documentation](https://www.scintilla.org/ScintillaDoc.html) for those commands: you can look at the `SCI_xxxx` in the shortcut mapper, then search for that text on [their ScintillaDoc page](https://www.scintilla.org/ScintillaDoc.html) to find out more about that command.
124+
125+
But with so many commands, and the fact that no documentation set is likely to ever explain _everything_ in the way that makes the most sense to you (what makes sense to one user might be really confusing to another), it might be fruitful to play with some of those commands to see for yourself what they do. (Notepad++ doesn't let you edit text while the **Shortcut Mapper** is open: one possible method of doing this experimentation is to have two instances of Notepad++ running, and have the **Shortcut Mapper** open to the **Scintilla commands** in one instance, and play with using them in the editor in the other Notepad++ instance.)

content/docs/preferences.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,9 @@ The message area will tell you if there are "no shortcut conflicts for this item
536536

537537
The Filter input allows you to enter a piece of literal text, and it will filter all the Names in the active tab for a given text substring, only listing the Names that contain that literal substring, ignoring case. There are no regular expression or wildcard syntax interpretations in the Filter.
538538

539-
Use the Modify button to edit the existing shortcut or to create a shortcut for an entry that has none. The resulting dialog will show the Name of the active action. There are checkboxes to enable the CTRL, ALT, and SHIFT key-modifiers. The main key in the shortcut is defined by the pulldown menu. Hitting OK will apply the added or changed shortcut and leave the dialog. Cancel will undo your changes and leave the dialog. (Please note that if you are using some localizations, the key you select [might not match](https://notepad-plus-plus.org/community/topic/17679/using-caret-circumflex-key-for-a-shortcut/10) <!-- TODO = this link should really refer to a submitted issue request, rather than a forum-topic --> what key you type: whatever key in your locale uses the same keycode as the standard US English keyboard will be the actual key.) In the `Scintilla commands` tab, you can actually assign more than one shortcut to a given Scintilla command, so there is an extra pane listing existing shortcuts, and additional Add and Remove buttons.
539+
Use the Modify button to edit the existing shortcut or to create a shortcut for an entry that has none. The resulting dialog will show the Name of the active action. There are checkboxes to enable the CTRL, ALT, and SHIFT key-modifiers. The main key in the shortcut is defined by the pulldown menu. Hitting OK will apply the added or changed shortcut and leave the dialog. Cancel will undo your changes and leave the dialog. (Please note that if you are using some localizations, the key you select [might not match](https://notepad-plus-plus.org/community/topic/17679/using-caret-circumflex-key-for-a-shortcut/10) <!-- TODO = this link should really refer to a submitted issue request, rather than a forum-topic --> what key you type: whatever key in your locale uses the same keycode as the standard US English keyboard will be the actual key.)
540+
541+
In the `Scintilla commands` tab, you can actually assign more than one shortcut to a given Scintilla command, so there is an extra pane listing existing shortcuts, and additional Add and Remove buttons. For more on the meaning of the `SCI_xxxx` names in the `Scintilla commands` tab, see the section on [Other Editing Commands and Shortcuts](../editing/#other-editing-commands-and-shortcuts).
540542

541543
Use the Clear button to remove the existing shortcut for a given entry.
542544

0 commit comments

Comments
 (0)