Skip to content

Commit f4c882a

Browse files
committed
Configuration Files Details: mention the rest of the config files, and do one last cleanup pass before merging back into my main branch
1 parent cdc5e36 commit f4c882a

File tree

2 files changed

+60
-7
lines changed

2 files changed

+60
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Summary
2424
* [Plugins](content/docs/plugins.md)
2525
* [Preferences](content/docs/preferences.md)
2626
* [Themes](content/docs/themes.md)
27-
* [Syntax for the XML-based Configuration Files](content/docs/config-syntax.md)
27+
* [Configuration Files Details](content/docs/config-files.md)
2828
* [Command Line Arguments](content/docs/command-prompt.md)
2929
* [Shell Extension](content/docs/shell-extension.md)
3030
* [Binary Translation](content/docs/binary-translation.md)

content/docs/config-files.md

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Configuration Files
2+
title: Configuration Files Details
33
linktitle: config-files
44
weight: 115
55
---
@@ -125,8 +125,23 @@ Position | Name | Value format | Meaning
125125

126126
Although it is possible for several commands to have the same name, this is confusing and thus discouraged.
127127

128-
The run command may contain any valid command for the <abbr title="Operating System: Generally Windows. If you use Notepad++ in a Linux WINE environment or similar, could you create a pull request clarifying whether it's windows-style command syntax or linux-style command syntax.">Windows OS</abbr>. Thus, if you enter a URL, Windows will launch your default browser with that URL.
129-
The commands use the same syntax and helper environment variables as explained in [TBD](#404-Not-Found "TBD: was External Programs NppWiki++ page; need to incorporate that in the new docset"). Use the concatenation characters as appropriate to have the OS execute several commands in a row.
128+
The run command may contain any valid command for the <abbr title="Operating System: Generally Windows. If you use Notepad++ in a Linux WINE environment or similar, could you create a pull request clarifying whether it's windows-style command syntax or linux-style command syntax.">Windows OS</abbr>. If you use a command that can be found in your PATH (like `cmd.exe`), then you don't need to specify the full path to the command. If it's not in your path, then you _should_ specify the full path. Note that Windows will launch your default browser if you put a URL in this If the command, or one of its arguments, has an embedded space, then put quotes around it (like you would for any command line environement). For example, `<Command name="Run Putty" ... >"c:\program files\putty\putty.exe" -ssh -load "my session"</Command>` shows the quotes around the executable and one of the arguments, because both have spaces.
129+
130+
There are a number of variables available, which are accessed in the form `$(VARIABLE_NAME)`, which can be used to supply portions of the command entry.
131+
132+
Variable | Description | Example
133+
--------------------|:--- |:---
134+
FULL_CURRENT_PATH | The full path to the active file | `E:\My Web\main\welcome.html`
135+
CURRENT_DIRECTORY | The active file's directory | `E:\My Web\main`
136+
FILE_NAME | The active file's name | `welcome.html`
137+
NAME_PART | The filename without extension | `welcome`
138+
EXT_PART | The extension | `html`
139+
SYS._var_ | the _var_ system environment variable | `$(SYS.PATH)` will expand to your `%PATH%` environment variable
140+
CURRENT_WORD | the active selection in Notepad++, or the word under the cursor |
141+
CURRENT_LINE | the line number where the cursor is currently located in the editor window | `1`
142+
CURRENT_COLUMN | the column number where the cursor is currently located in the editor window | `5`
143+
NPP_DIRECTORY | the directory where the `notepad++.exe` executable is located | `c:\Program Files\notepad++`
144+
NPP_FULL_FILE_PATH | the full path to the `notepad++.exe` | `c:\Program Files\notepad++\notepad++.exe`
130145

131146
## User Interface settings: `config.xml`
132147

@@ -165,10 +180,48 @@ Each lexer type has it's own `<LexerType>` section, with multiple `<WordsStyle>`
165180

166181
If you have added user-defined keywords in the [**Settings > Style Configurator**](../preferences/#style-configurator), they will be stored as the contents of the `<WordsStyle>`, as a space-separated list (for example, `<WordsStyle>fancyKeyword1 fancyKeyword2</WordsStyle>`).
167182

183+
## `functionList.xml`
184+
185+
Defines what counts as a "function" for **View > Function List**. There are some comments in the file, and lots of examples of the builtin languages, which you can customize.
186+
187+
If you want to add **Function List** capability for your User Defined Language (UDL), you can. You need to add two groups of information:
188+
189+
1. In the `<associationMap>` section, you need to add lines like the following
190+
191+
<association id="fn_udl_example" userDefinedLangName="ExampleUDL" />
192+
<association id="fn_udl_example" ext=".ex" />
193+
<association id="fn_udl_example" ext=".exudl" />
194+
195+
where `fn_udl_example` is a name unique to this UDL. It is best to define it both
196+
based on `userDefinedLangName=...` (which must match the name you saved for your UDL) and on extension `ext=...` (which must match the extension(s) of your UDL type, with one extension per entry).
197+
198+
2. In the `<parsers>` section, add a parser, with a similar format to all the builtin parsers shown. An example would be
199+
200+
<parser
201+
id="fn_udl_example"
202+
displayName="Example UDL Name (UDL)"
203+
commentExpr="((--.*?$))"
204+
>
205+
<function
206+
mainExpr="^[\s]*(private[\s]+)?(procedure|function)[\s]*[\w_]+"
207+
displayMode="$functionName"
208+
>
209+
<functionName>
210+
<nameExpr expr="^[\s]*(private[\s]+)?(procedure|function)[\s]*[\w_]+" />
211+
</functionName>
212+
</function>
213+
</parser>
214+
215+
where the `fn_udl_example` must match the `<association id>`. The `displayName` sets what shows in the **Function List** window header. The `...Expr` values are all defined in [regular expression syntax](../searching/#regular-expressions).
216+
168217
## Other Configuration Files
169218

170-
* `userDefineLang.xml`: see [in the User-defined Languages doc](../user-defined-language-system/).
219+
* `autoCompletion\*.xml`: files for defining per-language [auto-completion](../auto-completion/#auto-completion-file-format).
220+
221+
* `doLocalConf.xml`: this will only exist on local installations of Notepad++ (when you tell the installer to not use `%AppData%`, or when you install from the zipfile). This is a zero-byte file that is just used as an indicator to `notepad++.exe` to not go looking for `%AppData%`.
222+
223+
* `nativeLang.xml`: if you make a selection in the [**Settings > Preferences > General > Localization**](../preferences/#general), Notepad++ will copy the appropriate `localization\*.xml` to `nativeLang.xml`.
171224

172-
* Autocompletion, aka API, files: see [Auto-completion: Auto-completion File Format](http://localhost:1313/docs/auto-completion/#auto-completion-file-format)
225+
* `session.xml`: stores the current [session](../session/) information. Overwritten on every exit of Notepad++ if [**Settings > Preferences > Backup > Remember current session for next launch**](../preferences/#backup) is enabled. If you want sessions that you control, use **File > Save Session...** to save it; the file is safe to edit; and you can reload that session at any time using **File > Load Session...**.
173226

174-
* `session.xml`: stores session information
227+
* `userDefineLang.xml`: see [the **User Defined Languages** doc](../user-defined-language-system/).

0 commit comments

Comments
 (0)