Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Great <kbd> Update #644

Merged
merged 8 commits into from
Feb 26, 2024
Merged
16 changes: 8 additions & 8 deletions content/docs/auto-completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ weight: 60

Notepad++ offers automatic completion of various sorts of text after you have entered an initial substring (or prefix), which can save you having to type all of a long word (and potentially save you mistyping it). For instance, if you're coding in JavaScript and type `syn`, Notepad++ can present `synchronized` (a JavaScript keyword) as a suggestion. You accept the suggestion by typing the completion key (see "[Automatic completion](#automatic-completion)", below), and the word is completed within your buffer as if you'd typed it all out. If the suggested word is not what you want, keep typing.

If more than one word in the list of candidate words matches what you've typed, Notepad++ will present a list containing the words; the highlighted word in the list is the one that will be selected on the completion key, but you can use the Down- & Up-arrow keys, or PageDown & PageUp, to move through the list; or, type Esc to dismiss the list.
If more than one word in the list of candidate words matches what you've typed, Notepad++ will present a list containing the words; the highlighted word in the list is the one that will be selected on the completion key, but you can use the <kbd>Down-arrow</kbd> & <kbd<Up-arrow</kbd> keys, or <kbd>PageDown</kbd> & <kbd>PageUp</kbd>, to move through the list; or, type <kbd>Esc</kbd> to dismiss the list.

There are three sets of candidate words that Notepad++ uses to create suggestions; these are referred to as "words", "functions" and "system paths".

Expand All @@ -21,35 +21,35 @@ These function lists are stored in auto-completion definition files, each named

The auto-complete definition file can specify if a keyword is a function. When a function name has been typed in, followed by the opening parenthesis used to enclose the function's arguments, Notepad++ will automatically, or manually, display a hint (a.k.a. a "call tip"): a small tooltip-style box opens with text containing a description of the function. While the actual text shown is up to the author of the definition file, typically this would show, at minimum, a keyword for each of the parameters taken by the function call. This may save you a trip to the function's documentation to remember what those parameters are.

If there are multiple hint definitions for the current function, there will be up and down arrows (▲ ▼) in the tooltip box. You may click on those arrows, or use `Alt+UpArrow` or `Alt+DownArrow` keyboard shortcuts, to cycle through the parameter hints. (Those keyboard shortcuts are not listed in or affected by the Shortcut Mapper tool. The keyboard shortcuts are new to v8.4.5.)
If there are multiple hint definitions for the current function, there will be up and down arrows (▲ ▼) in the tooltip box. You may click on those arrows, or use <kbd>Alt+UpArrow</kbd> or <kbd>Alt+DownArrow</kbd> keyboard shortcuts, to cycle through the parameter hints. (Those keyboard shortcuts are not listed in or affected by the Shortcut Mapper tool. The keyboard shortcuts are new to v8.4.5.)

Notepad++ will display the hint automatically when the open-parenthesis is typed, if that option is selected in the Auto-Completion settings. The user can also select the "Function parameters hint" from the menu or by keystroke (default: `Ctrl+Shift+Space`), when the caret is between the opening and closing parentheses of the function call. And again, the hint can be dismissed with Esc.
Notepad++ will display the hint automatically when the open-parenthesis is typed, if that option is selected in the Auto-Completion settings. The user can also select the "Function parameters hint" from the menu or by keystroke (default: <kbd>Ctrl+Shift+Space</kbd>), when the caret is between the opening and closing parentheses of the function call. And again, the hint can be dismissed with <kbd>Esc</kbd>.

## Word completion

"Words" are taken from the current file—everywhere in the current file, comments and code. Any word two or more characters long is added to the list. This includes numbers, but numbers with decimal points are split into two different "words."

## Path completion

Different from function and word completion which can be triggered automatically after 1 (or X) keystroke(s), Path completion needs to be triggered manually, by using shortcut (default: `Ctrl+Alt+Space`) or via menu command **Edit > Auto-Completion > Path Completion** after typing the drive (for example "C:"). If the string on the left of caret is not part of one of the system paths, the path list won't appear.
Different from function and word completion which can be triggered automatically after 1 (or X) keystroke(s), Path completion needs to be triggered manually, by using shortcut (default: <kbd>Ctrl+Alt+Space</kbd>) or via menu command **Edit > Auto-Completion > Path Completion** after typing the drive (for example "C:"). If the string on the left of caret is not part of one of the system paths, the path list won't appear.

## How to make it work

### Automatic completion

The completion list can be triggered automatically as you type, via settings in [**Settings > Preferences > Auto-Completion**](../preferences/#auto-completion): Auto-Completion is controlled by a checkbox. Additionally there is a setting **From X th character**, accepting the minimum length of a prefix needed before the completion list is shown (some people like 2, some 3, some 4...); and, there is a setting to specify which candidates should be used: words, functions, or both.

With auto-completion active, after typing a prefix of at least the minimum length, a list is presented with all the available words from the selected list(s) that match what's been typed. (If none match, no list is shown.) The list may be a single entry long, or it may contain multiple items which require navigation, but either way you can select the match and, it is hoped, save yourself some typing. You can use arrow keys (or the mouse) to navigate through the entries in the popup; hitting the completion key or double-clicking on the choice will select that choice and enter it as if you had just typed the whole word; hitting the `Esc` key will exit the auto-completion popup _without_ choosing one of the suggestions.
With auto-completion active, after typing a prefix of at least the minimum length, a list is presented with all the available words from the selected list(s) that match what's been typed. (If none match, no list is shown.) The list may be a single entry long, or it may contain multiple items which require navigation, but either way you can select the match and, it is hoped, save yourself some typing. You can use arrow keys (or the mouse) to navigate through the entries in the popup; hitting the completion key or double-clicking on the choice will select that choice and enter it as if you had just typed the whole word; hitting the <kbd>Esc</kbd> key will exit the auto-completion popup _without_ choosing one of the suggestions.

If instead of selecting, you keep typing, items that no longer match will be removed from the list, and it will disappear entirely once you've typed a string that matches none of the selections. (Note that if you dismiss the list with Esc, and then keep typing, and what you type continues to match wordlist entries, then the list will reappear.)
If instead of selecting, you keep typing, items that no longer match will be removed from the list, and it will disappear entirely once you've typed a string that matches none of the selections. (Note that if you dismiss the list with <kbd>Esc</kbd>, and then keep typing, and what you type continues to match wordlist entries, then the list will reappear.)

#### Completion key

In v8.2 and earlier, both the `Tab` and `Enter` keys would be accepted as the completion key, without a configuration option to affect it. For v8.2.1 through v8.3, the default active completion key is `Tab`, though you can use [preferences](../preferences/#auto-completion) to set whether `Tab` is active, `Enter` is active, or both are active as completion key. Subsequent versions (v8.3.1 and newer) have both completion keys active by default, but the [preferences](../preferences/#auto-completion) will still allow the user to select which completion key(s) to have active. (_Note_: as with other [configuration file settings](../config-files/), upgrades will **not** overwrite a setting in an existing config.xml, so your choices made or saved in v8.2.1 through v8.3.0 will remain active through future upgrades; the defaults listed will only apply on new installations, or if there is no setting for `insertSelectedItemUseENTER` or `insertSelectedItemUseTAB` in the config.xml, or if the config.xml file has been deleted or otherwise doesn't exist and needs to be regenerated.)
In v8.2 and earlier, both the <kbd>Tab</kbd> and <kbd>Enter</kbd> keys would be accepted as the completion key, without a configuration option to affect it. For v8.2.1 through v8.3, the default active completion key is <kbd>Tab</kbd>, though you can use [preferences](../preferences/#auto-completion) to set whether <kbd>Tab</kbd> is active, <kbd>Enter</kbd> is active, or both are active as completion key. Subsequent versions (v8.3.1 and newer) have both completion keys active by default, but the [preferences](../preferences/#auto-completion) will still allow the user to select which completion key(s) to have active. (_Note_: as with other [configuration file settings](../config-files/), upgrades will **not** overwrite a setting in an existing config.xml, so your choices made or saved in v8.2.1 through v8.3.0 will remain active through future upgrades; the defaults listed will only apply on new installations, or if there is no setting for `insertSelectedItemUseENTER` or `insertSelectedItemUseTAB` in the config.xml, or if the config.xml file has been deleted or otherwise doesn't exist and needs to be regenerated.)

### Manual completion

If auto completion is turned off, you can manually force the completion of what you've typed, limiting the selection to either the list of functions or the list of words. By default, these functions are bound to `Ctrl+Space` (functions) or `Ctrl+Enter` (words); they are also available in the [Edit menu](../editing/#edit-menu). Typing one of these keystrokes or using those menu commands attempts an immediate completion: if there is a single matching entry in the wordlist, that entry is used, with no display of a list. If there are multiple matching entries, the list is displayed just as if auto-completion were triggered at the same point.
If auto completion is turned off, you can manually force the completion of what you've typed, limiting the selection to either the list of functions or the list of words. By default, these functions are bound to <kbd>Ctrl+Space</kbd> (functions) or <kbd>Ctrl+Enter</kbd> (words); they are also available in the [Edit menu](../editing/#edit-menu). Typing one of these keystrokes or using those menu commands attempts an immediate completion: if there is a single matching entry in the wordlist, that entry is used, with no display of a list. If there are multiple matching entries, the list is displayed just as if auto-completion were triggered at the same point.

Note: Manual "Function completion" (currently) shows a list of all the functions in the wordlist, even if they don't match the current prefix—unless no function matches the prefix, in which case no list is shown. Manual "Word completion" shows only the matching words.

Expand Down
2 changes: 1 addition & 1 deletion content/docs/binary-translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The process of teaching Notepad++ a new language is virtually identical to editi
- These are used for quickly activating a menu entry from the keyboard when the menu is active.
- For example, the **File** menu's **New** command has an accelerator of `N` defined in the default English localization file, so when the **File** menu is displayed, typing `N` will run that command.
- This is separate from the keyboard shortcut used while editing.
- For example, the **File** menu's **New** command has a default keyboard shortcut of `Ctrl+N`, which can be used anytime the editor section of Notepad++ is active. But if you have the **File** menu showing, `Ctrl+N` does nothing; instead, you have to use the accelerator.
- For example, the **File** menu's **New** command has a default keyboard shortcut of <kbd>Ctrl+N</kbd>, which can be used anytime the editor section of Notepad++ is active. But if you have the **File** menu showing, <kbd>Ctrl+N</kbd> does nothing; instead, you have to use the accelerator.
- Thus, even commands that have keyboard shortcuts should also have accelerators defined.
- To define the accelerator character, you need to put an ampersand `&` before the appropriate character in your translation text.
- Because the localization file is in XML, and `&` has a special meaning to XML, you need to use the string `&amp;` before the letter in your translation string.
Expand Down
4 changes: 2 additions & 2 deletions content/docs/config-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In a standard installation, the per-user configuration files go in `%AppData%\No

In a portable installation, the configuration files all go in the same directory as the `notepad++.exe` executable (or the appropriate subdirectory), and there is no per-user configuration location. (An installation is treated as "portable" if the zero-byte `doLocalConf.xml` file is present alongside the `notepad++.exe` executable. The **?** menu's **Debug Info** will show `Local mode: ON` for a portable version.)

If you enable the [Cloud settings](../preferences/#cloud), some per-user configuration files will go in the defined directory, including `contextMenu.xml`, `shortcuts.xml`, `userDefineLang.xml`, `langs.xml`, `stylers.xml`, and `config.xml`; the `userDefineLang\` subfolder can be placed there as well, though it won't be created by default when the Cloud settings folder is first populated. It should be emphasized that `session.xml` does _not_ work in the cloud folder, so if you have the cloud settings, `session.xml` will still be found in either the `%AppData%` hierarchy for a normal installation, or in the installed directory for a portable installation.
If you enable the [Cloud settings](../preferences/#cloud), some per-user configuration files will go in the defined directory, including `contextMenu.xml`, `shortcuts.xml`, `userDefineLang.xml`, `langs.xml`, `stylers.xml`, and `config.xml`; the `userDefineLang\` subfolder can be placed there as well, though it won't be created by default when the Cloud settings folder is first populated. It should be emphasized that `session.xml` does _not_ work in the cloud folder, so if you have the cloud settings, `session.xml` will still be found in either the `%AppData%` hierarchy for a normal installation, or in the installed directory for a portable installation.

There is a [command-line option](../command-prompt/) `-settingsDir` which will set a new directory for the per-user configuration file location. (Unlike the cloud directory, `session.xml` does work in the `-settingsDir` directory, so if you want to have all your per-user configuration, including your session information, in your cloud folder, it might be wise to not use the Cloud settings option, and instead point `-settingsDir` to the cloud folder.)

Expand Down Expand Up @@ -419,7 +419,7 @@ You can have multiple icon set directories; to switch between icon sets, you jus

- `noColumnToMultiSelect.xml`: This is a zero-byte file that is used as an indicator to Notepad++ to not enable the [column-mode to multi-edit conversion](../editing/#multi-editing) feature (new to v8.6.1). This file needs to be in `%AppData%\Notepad++\` for a normal installation and in the portable directory for a local configuration. Starting in v8.6.3, this zero-byte file was replaced by [**Settings > Preferences > Editing 2 > ☐ Enable Column Selection to Multi-Editing**](../preferences/#editing-2); if you used `noColumnToMultiSelect.xml` in v8.6.1-v8.6.2, to maintain the same behavior, you will need to make sure the new setting is not checkmarked; as of v8.6.3, this file is ignored and does nothing.

- `noEasterEggs.xml`: This is a zero-byte file that is used as an indicator to `notepad++.exe` to not show the "Easter Eggs" in the **About Notepad++** dialog (accessed from the **?** menu or the default keyboard shortcut `F1`). This config file _must_ go in the Notepad++ installation folder; it will not be recognized in the `%AppData%\Notepad++` hierarchy or in the cloud settings folder.
- `noEasterEggs.xml`: This is a zero-byte file that is used as an indicator to `notepad++.exe` to not show the "Easter Eggs" in the **About Notepad++** dialog (accessed from the **?** menu or the default keyboard shortcut <kbd>F1</kbd>). This config file _must_ go in the Notepad++ installation folder; it will not be recognized in the `%AppData%\Notepad++` hierarchy or in the cloud settings folder.

- `noRestartAutomatically.xml`: Starting in Notepad++ v8.5.8, Notepad++ is a [Restarable App](../other-resources/#restartable-app). If you would like to _disable_ Notepad++ from being restartable, add an empty config file called `noRestartAutomatically.xml` into `%APPDATA%\Notepad++\` (for normal installations) or the Notepad++ installation directory (for other configuration settings). If that file exists, and you'd like Notepad++ to be restartable again, just delete that file.

Expand Down
Loading