Sign in Join
Wiki copytemporary

CudaText: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: CudaText

OldNewLine
1+CudaText documentation subpages [[CudaText API|API]] | [[CudaText VS other editors|Comparisons with other text editors]] | [[CudaText plugins|Plugins]] | [[CudaText/LSP Client|LSP Client]] | [[CudaText files formats|Supported file formats]]
2+---|---|---|---|---
3+External Links | [project homepage](<https://cudatext.github.io/>) | [_downloads_](<https://sourceforge.net/projects/cudatext/files/release/>) | [github repository](<https://github.com/Alexey-T/CudaText>) | [_other required lazarus packages_](<https://github.com/Alexey-T>)
4+---|---|---|---|---
5+
6+**CudaText** is a cross-platform text editor, written in Object Pascal language using the Lazarus IDE, with a focus on performance and a broad featureset, which includes:
7+
8+ * Syntax highlighting for 300+ languages
9+ * Multi-carets, multi-selections
10+ * Code folding
11+ * Code-tree (list of functions/classes/etc., if lexer-supported)
12+ * Search/replace with regular expressions
13+
14+ * Command palette
15+ * Configuration files in JSON
16+ * Interface- and syntax-themes
17+ * Support for many encodings
18+ * Based on the [[ATSynEdit]] engine
19+ * Extensibility via Python add-ons, e.g. [LSP](<http://www.wikipedia.org/wiki/Language_Server_Protocol> "wikipedia:Language Server Protocol") support
20+
21+ * Built-in HTML and CSS auto-completion
22+ * HTML tag completion with `⭾ Tab`
23+ * HTML tooltips on mouse-over
24+ * Hex color code underlining
25+ * Viewer for picture files (jpeg, png, gif, bmp, ico, webp)
26+
27+[![CudaText UI Elements](/wiki-images/b/ba/cudatext-ui-elements.png)](</File:cudatext-ui-elements.png> "CudaText UI Elements")
28+
29+ed
30+ Main editor field.
31+gut
32+ Gutter, contains several columns for the active editor: bookmark icons, line numbers, folding icons, line-state marks.
33+tabs
34+ UI-tabs, to switch between different documents.
35+map
36+ Mini-map (left side), which is shown here together with micro-map (thin bar on the right side).
37+tree
38+ Code-tree, shows 'symbols' from the active document (functions, classes, structs etc) in the tree view.
39+filt
40+ Filtering input field for the code-tree. Leaves only those items which contain entered text.
41+
42+tb
43+ Toolbar: buttons for some commands. Hidden by default. Configurable via plugin Config Toolbar.
44+sb
45+ Sidebar. Vertical bar with buttons to activate different parts of the **side panel** : Code-Tree (built-in), Project Manager (plugin), Snippet Panel (plugin) etc. Sidebar buttons on the bottom half activate parts of the **bottom (horizontal) panel** : Console panel, Output panel etc. Plugins can add buttons to sidebar, for example the bottom black icon is the ExTerminal plugin.
46+cons
47+ Console. One of the bottom panels. You can activate others (Output and Validate panels) via sidebar.
48+stat
49+ Statusbar. Has several cells to show some current states.
50+bre
51+ Breadcrumb bar, clickable filepath entries provided by an optional [plugin](<https://github.com/CudaText-addons/cuda_breadcrumbs>) available in the Addons Manager.
52+
53+## Configuration
54+
55+The CudaText configuration system uses JSON files: call menu item "Options | Settings - default" and you'll see the default configuration file `default.json`. Copy lines from this file to the file `user.json` displayed by selecting the menu item "Options | Settings - user" and edit the values there to customize your user configuration. The `user.json` is the actual configuration file, the default configuration is provided solely to use as a reference.
56+
57+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png) **Note:** You can copy the JSON comments from the default file into your user configuration, too. In the user config, include useful lines inside the curly braces `{ }`, this is JSON formatting. Trailing commas on the final key:value pair before a closing brace (`}`) are allowed here.
58+
59+Default config
60+ File `settings_default/default.json`, can be opened via menu item "Options | Settings - default". CudaText doesn't use this file, it's only for user reference. CudaText only opens this file by the command, and this file is parsed by plugin "Options Editor Lite".
61+Hotkeys (keyboard shortcuts) config
62+ File `settings/keys.json`. Special dialog allows to change all hotkeys in CudaText. You should not edit this file directly, without using the dialog. Dialog is called from "View | Command palette" by pressing `F9`. Dialog allows to set primary+secondary hotkeys for any command (except dynamically added commands which, for example, change current lexer).
63+Plugin configs
64+ Files `settings/cuda_*`. Plugins store their settings in there, and files can be in any format (most commonly JSON or INI). Good quality plugins provide menu items in "Options | Settings - plugins" to open their config file, or to show configuration dialog.
65+History files
66+ Files `settings/history*.json`. Don't edit them. Mentioned here because sometimes users need to delete their history files (dialog positions, recent files list etc, recent search strings etc).
67+
68+User config
69+ File `settings/user.json`. Can be opened via menu item "Options | Settings - user".
70+User lexer-specific configs
71+ Files `settings/lexer NNN.json`. It is layer which is read after user config, when user activates some lexer. E.g. if you open C file, config file `lexer C.json` is read. You should not write `ui_` options to lexer-specific configuration files (they may produce weird effects when changing lexers), and some other global options.
72+
73+ * For (None) lexer, config file is named `lexer -.json`.
74+ * For lite lexers, configuration filenames are appended with a circumflex, e.g. `lexer XML ^.json`
75+
76+Default lexer-specific configs
77+ Files `settings_default/lexer NNN.json`. It is layer which is read after user config, but before lexer specific config. CudaText provides several such files, with useful defaults.
78+Lexer-specific hotkeys configs
79+ Files `settings/keys lexer NNN.json`. Each such config contains hotkeys for one lexer only.
80+
81+### File types
82+
83+_Example configuration blocks in_ `user.json`
84+```
85+{
86+ …
87+ "detect": {
88+ "*.mht": "HTML",
89+ "myconfig.conf": "Nginx",
90+ ".profile": "Bash script",
91+ },
92+ …
93+ }
94+```
95+
96+---
97+```
98+{
99+ …
100+ "detect_line": {
101+ "<html.*": "HTML",
102+ "<!DOCTYPE.*": "HTML",
103+ "<\\?xml.*": "XML",
104+ },
105+ …
106+ }
107+```
108+
109+The key:value pairs in the `"detect"` object in `user.json` specify mappings from filename to lexer name.
110+
111+ * Each key name represents a single mask or several ';'-separated masks. Masks can be "foo", "*foo", "foo*", "*.foo", "*.foo.bar" etc.
112+ * Each key value must map to a lexer name. A value of `-` prevents all automatic lexer activation.
113+
114+Another method to specify these mappings is the "Lexer properties" dialog where you can add extension or name+extension assignments to a specific lexer, however it has limitations; notably, since it saves the custom mappings to the lexer file itself (located in `data/lexlib/lexername.lcf`), those settings will be erased upon re-installation of the lexer or (if it is among the preinstalled lexers) updating to a new version of CudaText.
115+
116+### Language detection by first line regex
117+
118+The key:value pairs in the `"detect_line"` object in `user.json` create rule definitions that trigger lexer activation based on the contents of the first line of a file.
119+
120+ * Key name: A case-sensitive (you can use the `(?i)` modifier to disable case-sensitivity) regular expression evaluated using the first line of the file. Note that this is a regular expression using syntax similar to [PCRE](<http://www.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions> "wikipedia:Perl Compatible Regular Expressions"), so for example the `#` character must be escaped with a backslash, and instead of a simple `*` filemask, you must use `.*`. Also note that the current implementation cannot handle forward slashes "/" well, so escape them or use a `.` wildcard instead.
121+ * Key value: Lexer name. As noted earlier, a value of `-` means "don't activate a lexer".
122+
123+CudaText has several default values:
124+```
125+"<\?xml .+": "XML",
126+ "\#!\/bin\/(ba)?sh": "Bash script",
127+ "\#!\/usr\/bin\/env (ba)?sh": "Bash script",
128+ "\#!\/usr\/bin\/env python\d*": "Python",
129+ "\#!.*\b(node|js|bun|osascript\s+-l\s+JavaScript)": "JavaScript",
130+```
131+
132+### Plugins menu custom groupings
133+```
134+{
135+ …
136+ "plugin_groups": {
137+ "CSS .+": "Web",
138+ "HTML .+": "Web",
139+ "JS .+": "Web",
140+ "Config.+": "Config",
141+ "Option.+": "Config",
142+ },
143+ …
144+ }
145+```
146+
147+The "plugin_groups" object in `user.json` allows configuring custom groupings in the Plugins menu, e.g. putting all "HTML …" and "CSS …" menu items into a "Web" submenu. For example:
148+
149+ * Key name: A regular expression for the top level of the menu name, e.g. if the menu name in a plugin's `install.inf` is `CSS Utils\Misc\Action`, the top level is `CSS Utils`.
150+ * Key value: The group name; the `\` character provides the ability make nested sub-menus.
151+
152+### Location of 'settings', 'py', 'data' folders
153+
154+CudaText distributions are portable, if the executable file is located near the "data" sub-folder. So the distribution for Windows is portable (executable "cudatext.exe" is located near "data"), and distributions from .xz archives are portable too.
155+
156+Not portable CudaText:
157+
158+ * Linux: .deb package, which installs binary file to `/usr/bin/cudatext` and several data folders to `/usr/share/cudatext`.
159+ * macOS: package, which installs to the "Applications" system folder.
160+ * Haiku.
161+
162+For not portable usage, folder "settings" is created here:
163+
164+ * Linux, *BSD, Solaris: `~/.config/cudatext`, or `${XDG_CONFIG_HOME}/cudatext` if that environment variable is set
165+ * macOS: `~/Library/Application Support/CudaText`
166+ * Haiku: `/boot/home/config/settings/cudatext`
167+
168+## Command line flags/arguments
169+
170+Usage:
171+```
172+cudatext [ flag … ] filename …
173+```
174+
175+Supported flags:
176+
177+`-h`/`--help`
178+ Show command-line help and exit.
179+`-v`/`--version`
180+ Show application version and exit.
181+`-z=value`
182+ Open files from command-line in internal viewer, using given viewer mode:
183+
184+ * `-z=text` — Text mode with variable line length, single-byte encodings
185+ * `-z=binary` — Text mode with fixed line length, single-byte encodings
186+ * `-z=hex` — Hexadecimal mode, single-byte encodings
187+ * `-z=unicode` — Text mode with variable line length, UTF-16 LE/BE encodings
188+ * `-z=uhex` — Hexadecimal mode, UTF-16 LE/BE encodings
189+
190+`-r`
191+ Open files from command-line in read-only mode.
192+`-n`
193+ Ignore option "ui_one_instance", and open new app window.
194+`-nsl`
195+ Don't load last session on start.
196+`-nss`
197+ Don't save last session on exit.
198+`-ns`
199+ Shortcut to "-nsl" together with "-nss".
200+`-nh`
201+ Don't load saved file history (caret, selection, scroll position, etc.).
202+`-nn`
203+ Don't suggest to create new file if command-line filename is not found.
204+`-e=value`
205+ Open all files from command-line in given encoding.
206+`-el`
207+ Show possible encoding names and exit.
208+`-s=folder`
209+ Specify full path of the "settings" folder, which contains all configuration files.
210+`-i`
211+ Read the contents of stdin to a new document (Linux-only). It can be used in a Linux shell like: `ls -l | cudatext -i`
212+`-verbose`
213+ Copy Python messages from Console panel to stdout (Linux-only).
214+`-id=name`
215+ Set a "group" for single-instance mode, so that an instance of "group1" will not interfere with instances of "group2". The default id is `cudatext.0`. Note: this switch is not supported on Windows.
216+`-w=left|top|width|height`
217+ Set the position/size of the main window. Up to 4 numbers can be specified, and any number can be skipped to keep its previous value.
218+`-c=cuda_module,method_name`
219+ Run the specified command plugin on startup. The command plugin is only applied to the currently active editor tab, so make sure you don't pass multiple filenames in the command line, and that the current session doesn't have multiple files. It is often used along with the `-n` and/or `-ns` flags. Need to learn the name of a "cuda_module"? It is the name of subfolder under the "py" folder. Likewise, to discover the "method_name" look for the value of the `method=` key in the `py/cuda_module/install.inf` file.
220+`-p=cuda_module#param1#param2…`
221+ Run the specified plugin, and pass to its "on_cli" event the specified param strings. The number of params must be expected by the plugin, e.g. the Differ plugin supports "on_cli" and expects two filenames. If params contain spaces, you must double-quote that entire command-line flag beginning with -p, as in `"-p=…"`.
222+
223+**Notes:**
224+
225+ * Filenames can be passed with suffix (at the end of each filename) specifying the line/column numbers for the initial placement of the caret: `@line` or `@line@column`
226+ * Folders can be specified too, they will be opened as a "project" in the Project Manager.
227+ * Project files (`*.cuda-proj`) can be loaded from the command line.
228+ * Non-existing filename can be specified, CudaText will ask if you wish to create the file.
229+ * File masks with the `*` wildcard are supported, e.g. `cudatext test/t*.htm*` will work.
230+ * Zip filenames can be specified, if they are zipped CudaText add-ons (zip file must contain "install.inf" in proper format).
231+
232+On macOS, you cannot run "cudatext" from the Terminal out of the box, but you can create an alias "cudatext" like this: `alias cudatext=open\ /Applications/CudaText.app\ --args`
233+
234+## Mouse shortcuts
235+
236+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png) **Note:** For macOS, use the `Cmd ⌘` key instead of the `Ctrl` key in all of the mouse shortcuts listed below.
237+
238+[![](/wiki-images/a/a7/atsynedit-carets.gif)](</File:atsynedit-carets.gif>)
239+
240+[](</File:atsynedit-carets.gif> "Enlarge")
241+
242+Multi-carets in action
243+
244+### Multi-carets
245+
246+Multi-carets are several carets at once. All carets work together for many editing commands: caret moving, text typing, deleting, selection with keyboard.
247+
248+ * `Ctrl`+Left click - Add/remove caret.
249+ * `Ctrl`+Middle click - Add/remove caret.
250+ * `Ctrl`+Left click and drag - Add caret with selection.
251+ * `Ctrl`+`⇧ Shift`+Left click - Add column of vertically-aligned carets, from the previous caret position to the clicked line.
252+
253+Dragging
254+
255+ * `⎇ Alt`+drag - Make **column selection**.
256+ * Drag on Gutter line numbers - Select text by entire lines.
257+ * Double left-click and immediately drag - Select text by words.
258+
259+Clicks
260+
261+ * Double left-click - Select clicked word; this behavior can be customized as described in **§ How to select extra symbols by double-click** using the `nonword_chars` option.
262+ * Triple left-click - Select entire line (block is limited by newline characters).
263+ * Middle-click - Configurable by option `mouse_middle_click`, choices are:
264+
265+ 0. **(0)** Nothing.
266+ 1. **(1)** Start "browser scrolling" mode: circle mark appears and mouse moving around this mark auto-scrolls text in 4 directions; speed of scrolling depends on distance of cursor from circle mark (any click to turn off).
267+ 2. **(2)** Paste from clipboard. This mimics Linux apps behaviour.
268+ 3. **(3)** Call "Go to definition" command.
269+
270+ * Click on Back/Forward mouse buttons - These clicks do nothing by default, but they produce keyboard actions BrowserBack/BrowserForward (extended keys on Windows keyboards), and so they can be assigned in the hotkeys setup dialog (`F9` in the Command Palette). For example, `Ctrl`+Back produces `Ctrl`+BrowserBack keyboard action.
271+
272+Miscellaneous
273+
274+ * `⇧ Shift`+`⎇ Alt`+Left-click - Make vertical (column) selection, from the first caret to the clicked position.
275+ * `⇧ Shift`+Scroll mouse wheel - Scroll text horizontally.
276+ * `Ctrl`+Scroll mouse wheel (with option `mouse_wheel_zoom: true`) - Zoom text in/out.
277+ * `Ctrl`+Scroll mouse wheel (in the picture viewer) - Zoom picture in/out.
278+ * `⇧ Shift`+Left-click on gutter line number - Select lines, from first caret position to the index of clicked line.
279+
280+Drag-drop of selected text block
281+
282+ * Dragging inside single document: if `Ctrl` is pressed during the drop (you should press `Ctrl` after dragging is started), block will be copied (not moved) to the pointed position.
283+ * Dragging to a different document (see **§ Groups of tabs**): if `Ctrl` is pressed during the drop, block will be moved (otherwise it will be copied).
284+
285+The command "Go to definition" can be called by different mouse shortcuts: by `Ctrl`+`⎇ Alt`+Left-click (default), `⎇ Alt`+Left-click, etc.; this depends on the `mouse_goto_definition` option.
286+
287+## Multi-selections
288+
289+[![](/wiki-images/b/b7/atsynedit-sel.gif)](</File:atsynedit-sel.gif>)
290+
291+[](</File:atsynedit-sel.gif> "Enlarge")
292+
293+Multi-selection feature
294+
295+If you place a caret with `Ctrl`+Left-click, the caret has no selection, whereas if you add a caret with `Ctrl`+Drag, the caret will have a selection. You can add selections to carets later, by `⇧ Shift`+`◀`/`▲`/`▼`/`▶`/`Home`/`End`, etc.
296+
297+Multi-selections are handled specially on copy/paste. If you copy selections, then move carets, then paste, paste will insert clipboard lines into carets: line-1 at caret-1, line-2 at caret-2 etc (only if carets count equals to lines count in clipboard, otherwise result is different).
298+
299+### Commands with selections
300+
301+Clipboard commands work with multi-carets and multi-selections the special way. Also "Delete char" commands (`Del ⌦`/`⌫ Backspace` keys) works the special way.
302+
303+Command | Behaviour with no selections | Behaviour with at least one selection
304+---|---|---
305+Copy to clipboard | Copies entire lines, containing carets. Ignores multiple carets on a same line. | Copies only selections text. Ignores carets without selections.
306+Cut to clipboard | Similarly to "Copy" without selections. | Similarly to "Copy" with selections.
307+Paste from clipboard | First, selections are cleared (deleted). Then, command pastes text into each caret position. Special case is when clipboard lines count equals to carets count - in this case, first line is inserted at first caret, second line is inserted at 2nd caret, etc.
308+Delete char left (Backspace) / Delete char right | Deletes one char at each caret position. | Deletes only selections text. Ignores carets without selections.
309+
310+## Lexers
311+
312+[![](/wiki-images/2/2f/cudatext-lexer-library.png)](</File:cudatext-lexer-library.png>)
313+
314+[](</File:cudatext-lexer-library.png> "Enlarge")
315+
316+CudaText lexer library
317+
318+Syntax highlighters in CudaText are called _lexers_ , and are compatible with the SynWrite editor (which is frozen). The Lexer engine itself is borrowed from [EControl.ru](<http://www.econtrol.ru/syntedit.html>), with modifications by Alexey Torgashin. The primary modification is the addition of support for folding code blocks in Python and other languages with indentation-based folding, while others include the porting from Delphi to Free Pascal along with various optimizations. EControl.ru's original lexer engine is closed source, but CudaText's version is open source, with the permission from EControl.ru.
319+
320+ * The **Lexer properties** dialog provides access to the configurable properties of the current lexer (selected via the status bar). Those properties are: lexer name, file types, commenting style, token colors, font styles (bold/italic/underline) and token borders.
321+ * The **Lexer library** dialog shows a list of the installed lexers, which reside in the folder `data/lexlib`. This dialog has the following hotkeys:
322+
323+
324+
325+
326+
327+`Enter ⏎`
328+ same as "Configure" button
329+`Del ⌦`
330+ same as "Delete" button
331+`Esc`
332+ closes the dialog
333+
334+[![](/wiki-images/a/a4/cudatext-zip-install-prompt.png)](</File:cudatext-zip-install-prompt.png>)
335+
336+[](</File:cudatext-zip-install-prompt.png> "Enlarge")
337+
338+Add-on ZIP file install dialog
339+
340+### Lexers on SourceForge
341+
342+CudaText installs with a limited set of lexers. All other lexers are available as [individual downloads hosted on cudatext.sf.net](<https://sourceforge.net/projects/cudatext/files/addons/lexers/>) or collectively as part of the [complete add-ons package](<https://sourceforge.net/projects/cudatext/files/addons_all/>), too.
343+
344+To install "lexer.*.zip" (or any add-on ZIP file) in CudaText: open this ZIP file via "File / Open", CudaText will suggest to install it.
345+
346+### List of lexers
347+
348+The following lexers (counting only important ones) exist for CudaText. They are available through the Addons Manager's **Install…** command.
349+
350+All these lexers, and preinstalled lexers, are published in the repository: <https://github.com/CudaText-addons/CudaText-lexers> . This link may be needed for people wanting to make 'Pull Requests' in Git.
351+
352+ * [1C:Enterprise script](<https://1c-dn.com/1c_enterprise/1c_programming_language/>)
353+ * [ABAP](<https://learning.sap-press.com/abap>)
354+ * [Abaqus Keywords](<https://www.3ds.com/products-services/simulia/products/abaqus/>)
355+ * [abc notation](<https://abcnotation.com/>)
356+ * [ActionScript](<https://help.adobe.com/en_US/as3/learn/index.html>)
357+ * [ACUCOBOL](<https://www.microfocus.com/en-us/products/acucobol-gt/overview>)
358+ * [Ada](<http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-TTL.html>)
359+ * [Adept](<https://www.met.reading.ac.uk/clouds/adept>)
360+ * [Amazon Ion](<https://amazon-ion.github.io/ion-docs/>)
361+ * [AMPL](<https://ampl.com/>)
362+ * [AngelScript](<https://www.angelcode.com/angelscript/>)
363+ * [ANTLR](<https://www.antlr.org/>)
364+ * [APDL](<https://www.ansys.com/blog/what-is-apdl>)
365+ * [AppleScript](<https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html>)
366+ * [Arduino](<https://www.arduino.cc/reference/en/>)
367+ * [AsciiDoc](<https://asciidoc.org/>)
368+ * [Assembly (ASM)](<http://www.wikipedia.org/wiki/Assembly_language> "wikipedia:Assembly language"):
369+ * [ARM Assembly (armasm)](<https://developer.arm.com/documentation/102438/0100/Learning-about-assembly-language>)
370+ * [STM32 ARM Assembly](<https://blog.st.com/stdevcon18-stm32-embedded-systems-assembly/>)
371+ * [AVR Assembly (AVRASM2)](<https://ww1.microchip.com/downloads/en/DeviceDoc/40001917A.pdf>)
372+ * [Dalvik bytecode (Smali)](<https://source.android.com/docs/core/runtime/dalvik-bytecode>)
373+ * [Flat Assembly (fasm)](<https://flatassembler.net/>)
374+ * [Game Boy/GB Color Assembly (RGBDS)](<https://rgbds.gbdev.io/>)
375+ * [GNU Assembly (as/gas)](<https://sourceware.org/binutils/docs-2.41/as.html>)
376+ * [JWasm Assembly](<https://www.japheth.de/JWasm/Manual.html>)
377+ * [Microsoft Macro Assembler x86/x64 (MASM)](<https://learn.microsoft.com/en-us/cpp/assembler/masm/microsoft-macro-assembler-reference?view=msvc-170>)
378+ * [MIPS Assembly](<https://web.cse.ohio-state.edu/~crawfis.3/cse675-02/Slides/MIPS%20Instruction%20Set.pdf>)
379+ * [Motorola 68000 Assembly](<http://68k.hax.com/>)
380+ * [Netwide Assembly x86 (NASM)](<https://www.nasm.us/>)
381+ * [PowerPC Assembly](<http://wikibooks.org/wiki/PowerPC_Assembly> "wikibooks:PowerPC Assembly")
382+ * [RISC-V Assembly](<http://www.wikipedia.org/wiki/RISC-V_assembly_language> "wikipedia:RISC-V assembly language")
383+ * [SHARC DSP Assembly](<https://www.analog.com/media/en/dsp-documentation/processor-manuals/236999443isr_21xxx.pdf>)
384+ * [SPARC Assembly](<http://wikibooks.org/wiki/SPARC_Assembly> "wikibooks:SPARC Assembly")
385+ * [Z80 Assembly (SjASM)](<https://xl2s.tk/sjasmmanual.html>)
386+ * [Astro](<https://astro.build/>)
387+ * [Asymptote](<http://www.wikipedia.org/wiki/Asymptote_\(vector_graphics_language\)> "wikipedia:Asymptote \(vector graphics language\)")
388+ * [AutoHotkey](<https://www.autohotkey.com/docs/v2/Language.htm>)
389+ * [AutoIt](<http://www.wikipedia.org/wiki/AutoIt> "wikipedia:AutoIt")
390+ * [Automake](<http://www.wikipedia.org/wiki/Automake> "wikipedia:Automake")
391+ * [Automation Basic (B&R Automation Studio)](<https://www.br-automation.com/en-us/products/software/additional-information/programming/#c56724>)
392+ * [AviSynth](<http://avisynth.nl/index.php/The_full_AviSynth_grammar>)
393+ * [AWK](<http://www.wikipedia.org/wiki/AWK> "wikipedia:AWK")
394+ * [Ballerina](<http://www.wikipedia.org/wiki/Ballerina_\(programming_language\)> "wikipedia:Ballerina \(programming language\)")
395+ * [Bash shell](<http://www.wikipedia.org/wiki/Bash_\(Unix_shell\)> "wikipedia:Bash \(Unix shell\)")
396+ * [Batch file](<http://www.wikipedia.org/wiki/Batch_file> "wikipedia:Batch file")
397+ * [Bazel configuration (bazelrc)](<https://bazel.build/run/bazelrc>)
398+ * [BibTeX](<http://www.wikipedia.org/wiki/BibTeX> "wikipedia:BibTeX")
399+ * [Bicep (Azure Resource Manager)](<https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/file>)
400+ * [Blueprint (GTK 4 UI compiler)](<https://gnome.pages.gitlab.gnome.org/blueprint-compiler/>)
401+ * [Bohemia Real Virtuality (SQF)](<https://community.bistudio.com/wiki/SQF_Syntax>)
402+ * [Boo](<http://www.wikipedia.org/wiki/Boo_\(programming_language\)> "wikipedia:Boo \(programming language\)")
403+ * [Brainfuck](<http://www.wikipedia.org/wiki/Brainfuck> "wikipedia:Brainfuck")
404+ * [C](<http://www.wikipedia.org/wiki/C_\(programming_language\)> "wikipedia:C \(programming language\)")
405+ * [C++](<http://www.wikipedia.org/wiki/C%2B%2B> "wikipedia:C++")
406+ * [C#](<http://www.wikipedia.org/wiki/C_Sharp_\(programming_language\)> "wikipedia:C Sharp \(programming language\)")
407+ * [C3](<https://c3-lang.org/>)
408+ * [Caffe (prototxt)](<https://caffe.berkeleyvision.org/>)
409+ * [Cangjie](<http://www.wikipedia.org/wiki/Cangjie_\(programming_language\)> "wikipedia:Cangjie \(programming language\)")
410+ * [Carbon](<http://www.wikipedia.org/wiki/Carbon_\(programming_language\)> "wikipedia:Carbon \(programming language\)")
411+ * [Clarion](<http://www.wikipedia.org/wiki/Clarion_\(programming_language\)> "wikipedia:Clarion \(programming language\)")
412+ * Clavier
413+ * [Clipper](<http://www.wikipedia.org/wiki/Clipper_\(programming_language\)> "wikipedia:Clipper \(programming language\)")
414+ * [Clojure](<http://www.wikipedia.org/wiki/Clojure> "wikipedia:Clojure")
415+ * [CMake](<http://www.wikipedia.org/wiki/CMake> "wikipedia:CMake")
416+ * [COBOL](<http://www.wikipedia.org/wiki/COBOL> "wikipedia:COBOL")
417+ * [CodeVisionAVR](<https://www.codevision.be/>)
418+ * [CoffeeScript](<http://www.wikipedia.org/wiki/CoffeeScript> "wikipedia:CoffeeScript")
419+ * [ColdFusion markup](<http://www.wikipedia.org/wiki/ColdFusion_Markup_Language> "wikipedia:ColdFusion Markup Language")
420+ * [Conditional Random Fields (CRF)](<http://www.wikipedia.org/wiki/Conditional_random_field> "wikipedia:Conditional random field")
421+ * [Crystal](<http://www.wikipedia.org/wiki/Crystal_\(programming_language\)> "wikipedia:Crystal \(programming language\)")
422+ * [CSS](<http://www.wikipedia.org/wiki/CSS> "wikipedia:CSS")
423+ * [CUDA C++](<https://docs.nvidia.com/cuda/cuda-programming-guide/02-basics/intro-to-cuda-cpp.html>)
424+ * [CUE](<https://cuelang.org/>)
425+ * [Cue sheet](<http://www.wikipedia.org/wiki/Cue_sheet_\(computing\)> "wikipedia:Cue sheet \(computing\)")
426+ * [Colecovision BASIC {CVBasic)](<https://nanochess.org/cvbasic.html>)
427+ * [D](<https://dlang.org/>)
428+ * [Dafny](<https://dafny.org/>)
429+ * [Dart](<https://dart.dev/>)
430+ * [Delphi resources](<https://www.delphibasics.info/home/delphibasicssnippets/usingresourcefileswithdelphi>)
431+ * [Dhall](<https://dhall-lang.org/>)
432+ * [Dictu](<https://dictu-lang.com/>)
433+ * [Diff / Patch files](<http://www.wikipedia.org/wiki/diff#Default_output_format> "wikipedia:diff")
434+ * [Dockerfile](<https://docs.docker.com/build/concepts/dockerfile/>)
435+ * [DOORS Extension Language (DXL)](<http://www.wikipedia.org/wiki/DOORS_Extension_Language> "wikipedia:DOORS Extension Language")
436+ * [Eiffel](<http://www.wikipedia.org/wiki/Eiffel_\(programming_language\)> "wikipedia:Eiffel \(programming language\)")
437+ * [Elixir](<https://elixir-lang.org/>)
438+ * [Elm](<https://elm-lang.org/>)
439+ * [.env files](<https://www.dotenv.org/docs>)
440+ * [Erlang](<https://www.erlang.org/>)
441+ * [Embedded Lua templates](<https://github.com/leafo/etlua>)
442+ * [Euphoria](<http://www.wikipedia.org/wiki/Euphoria_\(programming_language\)> "wikipedia:Euphoria \(programming language\)")
443+ * F#
444+ * Factor
445+ * Falcon
446+ * Fish
447+ * FIX Message (Financial Information eXchange)
448+ * foobar2000 title formatting (it's for Mp3tag too)
449+ * Forth
450+ * Fortran
451+ * FoxPro
452+ * FreeBASIC
453+ * Futhark
454+ * G-code (this is "lite" lexer)
455+ * GAMS
456+ * GDScript
457+ * [Gel Schema Definition Language (EdgeQL)](<https://docs.geldata.com/learn/schema>)
458+ * Gemini (web pages)
459+ * Gherkin (Cucumber; Behat)
460+ * GHS.com MULTI IDE (3 lexers)
461+ * Gleam
462+ * GLSL
463+ * GNU linker
464+ * Gnuplot
465+ * Go
466+ * Gold Parser
467+ * Grails Server Pages (GSP)
468+ * Graphviz DOT
469+ * GraphQL
470+ * Great Cow Basic
471+ * Groovy (Gradle)
472+ * Grub4Dos
473+ * Haml
474+ * Harbour
475+ * Hare
476+ * Haskell
477+ * Haxe
478+ * HCL (HashiCorp Configuration Language)
479+ * Heta
480+ * [HiveQL (Apache Hive)](<https://cwiki.apache.org/confluence/display/Hive/LanguageManual>)
481+ * HJSON
482+ * HLSL
483+ * HTML
484+ * HTML Diafan
485+ * HTML Django DTL
486+ * HTML Embedded JS
487+ * HTML Handlebars
488+ * HTML Laravel Blade
489+ * HTML Liquid
490+ * HTML Mustache
491+ * HTML Ruby-ERB
492+ * HTML Smarty
493+ * [httpd.conf (Apache HTTP Server)](<https://httpd.apache.org/docs/2.4/configuring.html>)
494+ * Huawei VRP
495+ * IDL files
496+ * IDL language
497+ * Informix 4GL
498+ * Ini files
499+ * Inno Setup
500+ * Intel HEX
501+ * Intel ISPC (Implicit SPMD Program Compiler)
502+ * Janet
503+ * Jasmine JVM Assembler
504+ * Java
505+ * Java Velocity
506+ * JavaScript
507+ * JavaScript Babel/React JSX
508+ * JCL
509+ * Jinja2
510+ * JQ
511+ * JSON
512+ * [Bitsquid Simplified JSON (SJSON)](<https://bitsquid.blogspot.com/2009/10/simplified-json-notation.html>)
513+ * Jsonnet
514+ * Julia
515+ * Just
516+ * [KDL](<https://kdl.dev/>)
517+ * Kivy
518+ * KiXtart
519+ * Koka
520+ * Kontakt Script Processor (KSP)
521+ * Kotlin
522+ * languageONE
523+ * LaTeX
524+ * Lean
525+ * LESS
526+ * Lisp
527+ * [Common Lisp](<http://www.wikipedia.org/wiki/Common_Lisp> "wikipedia:Common Lisp")
528+ * LiveCode script
529+ * Log files
530+ * Logstash DSL
531+ * Lola-2
532+ * LS-DYNA
533+ * Lua
534+ * [M4](<http://www.wikipedia.org/wiki/m4_\(computer_language\)> "wikipedia:m4 \(computer language\)")
535+ * Macro Scheduler script
536+ * Makefile
537+ * Markdown
538+ * MATLAB
539+ * Maya
540+ * MDX (Markdown with JSX)
541+ * MediaWiki
542+ * Meson
543+ * Metafont
544+ * MIB files
545+ * MikroTik Script
546+ * MiniZinc
547+ * Modelica
548+ * Modula-2
549+ * Modula-3
550+ * Mojo
551+ * Monkey
552+ * MoonBit
553+ * MS Visual Studio Solution
554+ * MusicBrainz Picard Tagger Script
555+ * MySQL
556+ * Nelua
557+ * Nemerle
558+ * Nginx
559+ * Nim
560+ * Nix
561+ * nnCron
562+ * NSIS
563+ * NSL Assembler
564+ * Oberon (and Component Pascal)
565+ * Objeck
566+ * Objective-C
567+ * OCaml
568+ * Odin
569+ * OpenCL
570+ * OpenEdge
571+ * OpenSCAD
572+ * Org-mode
573+ * P4 (Programming Protocol-independent Packet Processors)
574+ * Papyrus (for Skyrim game)
575+ * Parser3
576+ * Pascal
577+ * Pawn
578+ * PECmd script
579+ * Perforce Jam
580+ * Perl
581+ * PHP
582+ * PICL
583+ * [Pig Latin (Apache Pig)](<https://pig.apache.org/docs/r0.17.0/start.html#pl-statements>)
584+ * Pike
585+ * Pixilang
586+ * PKGBUILD
587+ * Pkl
588+ * PL/SQL
589+ * PlantUML
590+ * Pony
591+ * PostScript
592+ * Power Query M
593+ * PowerShell
594+ * Prolog
595+ * Properties
596+ * Protocol Buffers
597+ * Pug (previosly named "Jade")
598+ * Puppet
599+ * PureBasic
600+ * PureScript
601+ * PyMOL
602+ * Pyret
603+ * Python
604+ * [Cython](<https://cython.org/>)
605+ * QML (Qt Modeling Language)
606+ * R
607+ * R Markdown
608+ * Racket
609+ * Rainmeter
610+ * Ragel
611+ * Raku
612+ * Razor
613+ * ReasonML
614+ * Red
615+ * ReScript
616+ * reStructuredText
617+ * Rexx
618+ * Ring
619+ * Roc
620+ * [Rocq Prover](<http://www.wikipedia.org/wiki/Rocq> "wikipedia:Rocq")
621+ * RON
622+ * RPG/IV
623+ * RTF (Rich Text)
624+ * Ruby
625+ * Rust
626+ * Sass
627+ * Scala
628+ * Scheme
629+ * Scilab
630+ * SCSS
631+ * SFZ Format
632+ * Singularity
633+ * Slim
634+ * Smalltalk
635+ * Snowflake SQL
636+ * Solidity (Ethereum)
637+ * Specman
638+ * SPICE (PSpice, HSPICE)
639+ * SPIR
640+ * SQL (normal and "lite" lexers available)
641+ * Squirrel
642+ * SRT Subtitles
643+ * Standard ML
644+ * STAR (Self-defining Text Archive and Retrieval) (this is "lite" lexer)
645+ * Stata
646+ * Strace
647+ * Structured Text (IEC 61131-3)
648+ * Stylus
649+ * Svelte
650+ * Swift
651+ * SystemTap
652+ * T-SQL
653+ * TAGML
654+ * TakeCommand
655+ * Tcl/Tk
656+ * Textile
657+ * ToDo (for plugin "Plain Tasks")
658+ * Todo.txt (format from todotxt.org)
659+ * TOML
660+ * Tree
661+ * Twig
662+ * TypeScript
663+ * Typst
664+ * Umka
665+ * V
666+ * Vala
667+ * VBScript
668+ * Verilog HDL
669+ * VHDL
670+ * Vimscript
671+ * Virgil
672+ * Visual Basic
673+ * Visual dBase
674+ * VRML
675+ * Vue
676+ * WGSL
677+ * WikidPad (normal and "lite" lexers available)
678+ * WinBuilder script
679+ * Windows Resource Script
680+ * Wolfram
681+ * Wren
682+ * WSH script
683+ * XML
684+ * XSLT
685+ * Yacc (Bison)
686+ * YAML
687+ * ZenScript (MineTweaker)
688+ * Zephir
689+ * Zig
690+ * Ziggy
691+
692+### Lexers modification and creation
693+
694+[![SynWrite "Lexer properties" dialog](/wiki-images/e/ed/cudatext-lexer-editor-dlg.png)](</File:cudatext-lexer-editor-dlg.png>)
695+
696+[](</File:cudatext-lexer-editor-dlg.png> "Enlarge")
697+
698+Screenshot of SynWrite's "Lexer properties" dialog
699+
700+You can modify/create lexers. But not in CudaText. Install [SynWrite](<https://cudatext.github.io/synwrite/>) (Windows program, which can be run under Wine on Linux). There, you have lexer editor dialog.
701+
702+ * First, install your lexer to SynWrite. From the lexer's .zip package, copy files lexername.lcf and lexername.cuda-lexmap into SynWrite's "data\lexlib" folder.
703+ * In SynWrite, call "Lexer properties" dialog and edit all you need.
704+ * In SynWrite, install "ExLexer" addon. Then call "ExLexer" from the "Plugins" menu, choose needed lexer to export. You will have exported .zip file.
705+ * In CudaText open this .zip file, confirm installation of lexer.
706+
707+### Lexers editing - styles only
708+
709+For full-featured lexer editing, you must use SynWrite as described in the topic above. CudaText itself allows to edit only lexer styles, ie colors/ borders/ font-style (bold/italic/strikeout) of lexer styles. How to do that:
710+
711+ * Activate some lexer for the current document.
712+ * Call CudaText menu "Options / Lexers / Lexer properties", dialog "Lexer properties" will open.
713+ * In the "Lexer properties" dialog, activate "Styles" tab, it has UI to customize styles in the active lexer. This UI is enabled only when lexer themes are Off, ie option `"ui_lexer_themes":false`.
714+
715+By default that option is On so UI is disabled. If you enable the UI, you can customize all lexer styles. Configuration will be saved to the files "settings/*.cuda-lexops". These files are auto-loaded by CudaText on start.
716+
717+### How to setup styles of hidden sublexer
718+
719+Some lexers are distributed in packages together with sub-lexer, and sub-lexer is hidden. Example: "HTML Django" with sub-lexer "HTML Django internal" (the second one isn't visible in the Lexers menu, so it's called hidden). Users, which have option "ui_lexer_themes" off, want to configure styles of all lexers. How to access hidden ones?
720+
721+ * Open "Lexer library" dialog (menu: Options / Lexer / Lexer library).
722+ * In dialog, focus needed lexer, press "Configure" button
723+ * Dialog "Lexer properties" will open for selected lexer
724+ * In dialog's "Styles" tab, configure all you need
725+
726+You can change visibility of lexer in SynWrite lexer editor (the checkbox will write line "Internal = True" at the end of .lcf file).
727+
728+### How to create distributive of new lexer
729+
730+In SynWrite, you've created .lcf file in folder SynWrite/Data/LexLib. If you configured "Commenting" options, also file .cuda-lexmap is created. Now you need to create .zip installation of lexer, for both editors: SynWrite, CudaText.
731+
732+ * In lexer file, replace system colors to usual colors: replace "clWindowText" to "clBlack" (clWindowText may be light on CudaText on Linux); replace "clInfoText" and "clInfoBk" too.
733+ * In SynWrite, in Addon Manager, install plugin "ExLexer".
734+ * In SynWrite, run menu item "Plugins / ExLexer", to create .zip for your lexer.
735+ * In CudaText, open this new zip file, this installs lexer to CudaText.
736+ * In CudaText, activate your lexer, dialog should show: "Lexer style mapping". Fill items in this dialog.
737+ * In CudaText, test this "lexer style map" in action: open file with your lexer active, and activate "default" UI theme, then activate "sub" UI theme. Main themes must show nice colors in your syntax file. Call dialog "Options / Lexers / Lexer style mapping" to fix colors.
738+ * In prev step, you configured .cuda-lexmap file, in folder CudaText/data/lexlib. Copy this file to zip installation of your lexer.
739+ * Zip must contain: install.inf, .lcf file(s), .cuda-lexmap file per each lexer.
740+
741+You can place file(s) "lexer LexerName.json" into zip archive, per each lexer in zip archive. These JSON files will be installed to the folder "settings_default" of CudaText. Ie, these are lexer-specific configs for lexers. Some lexers do this already: Lua, Pascal, PHP, Ruby, TypeScript.
742+
743+### Lite lexers
744+
745+Lite lexers are lexers is special format (internally it's JSON file), with very limited features. They don't support code-tree, folding, don't support multi-line comments, don't have rich highlighting (e.g. background highlight of string `12+$var` with additional highlight for 12 and $var inside). And they don't keep tokens information in memory (positions of found tokens in text). Lite lexers process only lines visible on screen, not all document lines. So, they work fast for any file size.
746+
747+Limitation: on lines longer than 4K chars, only first 4K chars have the syntax highlighting.
748+
749+Lite lexers have the " ^" suffix in name. You can activate lite lexers from the usual lexers menu. Several lite lexers are preinstalled:
750+
751+ * Ini files ^
752+ * JSON ^
753+ * Log files ^
754+ * SQL ^
755+ * XML ^
756+
757+Lite lexers are automatically activated for big files, when file size is bigger than option "ui_max_size_lexer". For example, for small sized JSON files normal "JSON" lexer is activated, but for huge JSON files - lite lexer "JSON ^" is automatically activated. Lite lexers are activated for small files, if normal lexer for file-extension is not found. For example, "SQL ^" is used for small SQL files, because "normal" SQL lexer is not preinstalled.
758+
759+How to change styles in lite lexers? For example, "Log files ^" uses styles "Id"/"Id2", and you want to change that? It's easy:
760+
761+ * open the file: [CudaText]/data/lexliblite/Log files.cuda-litelexer
762+ * find and edit styles names
763+ * all possible styles are listed in the CudaText dialog "Options / Themes / Settings - theme - syntax..."
764+
765+Here is short description of file fields, on the example file "data/lexliblite/Ini files.cuda-litelexer":
766+```
767+{
768+ "about": "INI lexer by Alexey Torgashin",
769+ "files": "*.ini;*.dsk;*.dti;*.dof;*.inf;*.lng;*.srv;*.reg;*.sas;*.cfg;*.desktop",
770+ "cmt_line": ";",
771+ "case_sens": true,
772+ "consider_spaces": true,
773+ "rules": {
774+ "cmt": {
775+ "regex": "^\\s*[;\\#].*",
776+ "style": "Comment"
777+ },
778+ ...
779+ "val": {
780+ "regex": "\\w+",
781+ "style": "Id"
782+ }
783+ }
784+ }
785+```
786+
787+ * "about": Info about file's author.
788+ * "files": One or several file masks, separated by ";".
789+ * "cmd_line": Single-line comment chars. Used by "Comments" plugin when you call commands of this plugin.
790+ * "case_sens": Boolean flag for case-sensitivity for RegEx-rules listed below in that file.
791+ * "consider_spaces": Boolean flag which enables to parse spaces/tabs between words by RegEx-rules. Otherwise, parser will skip spaces/tabs silently.
792+ * "rules": Dictionary with parser rules, which must have one or more dictionaries with any names but fixed contents:
793+ * "regex": RegEx (ie regular expression) of the rule.
794+ * "style": Style name, to color that rule results. Possible values are listed in the CudaText dialog "Options / Themes / Settings - theme - syntax..."
795+
796+### Differences in lexer support in CudaText/SynWrite
797+
798+ * SynWrite supports "lexer grammar", while CudaText does not support "grammar" anymore.
799+ * SynWrite lexers need constructs like \x0D\x0A or \z (to catch any line-break: LF, CRLF, CR), while CudaText lexers are OK with simple \n (because internal buffer always has LF separator).
800+ * Some lexers need to find equal identifiers at begin/end of blocks: HTML, Bash, others. Bash lexer needs extended feature: to see NAME and 'NAME' and "NAME" as equal identifiers (word and quoted word). Only CudaText has this extended feature, not SynWrite.
801+ * For CudaText you must avoid "system colors" in lexer styles (e.g. "window background", "window text", "hint background"), because OS'es have different system colors.
802+ * SynWrite lexer settings are not used in CudaText:
803+ * Option "Restart analysis from the line start" has no effect, it is forced to On in CudaText
804+ * Default style
805+ * Selection mark style
806+ * Search mark style
807+ * Current line style
808+ * Collapse mark style
809+ * Character set
810+ * Multiline border
811+ * Options in groups "Syntax tree decoration", "Pen"
812+
813+### How to make editor re-scan entire document on editing
814+
815+The question makes sense, because when user types the block ending (e.g. "}" in C syntax), editor re-scans the document from the last changed line, and cannot detect that new block is just appeared.
816+
817+Find the lexer file, .lcf file in the folder data/lexlib. This file has the ending with "end", before "end" you see several lexer settings. You can add there:
818+```
819+FullRefreshSize = 5000
820+```
821+
822+Insert it near the end of file, like here:
823+```
824+FullRefreshSize = 5000
825+ Charset = DEFAULT_CHARSET
826+ end
827+```
828+
829+This tells lexer to re-scan entire document, on editing in any document place, when document size is less than 5000 chars.
830+
831+### How to support Spell Checker in lexer
832+
833+Plugin "Spell Checker" checks text, which is inside "strings" and "comments". So you must configure lexer and set there, which lexer elements (tokens) are "strings" and "comments". It is options in the "Lexer properties" dialog of SynWrite, in the "Commenting" tab of dialog. You can change these options without SynWrite too - they are in the "data/lexlib/LexerName.cuda-lexmap" file, both options are comma-separated names of lexer styles.
834+
835+For example, let's see XML lexer. Spell Checker must handle these styles:
836+
837+ * style applied to XML/HTML comments
838+ * style applied to quoted strings in XML tags
839+ * style applied to usual text out of angle brackets
840+
841+If you see lexer config in SynWrite, you will find that we need styles "Comment", "Text" and "Tag val". So we specify in the file "data/lexlib/XML.cuda-lexmap":
842+```
843+[comments]
844+ styles_cmt=Comment
845+ styles_str=Text,Tag val
846+```
847+
848+## Fenced code-blocks
849+
850+[![](/wiki-images/5/59/cudatext-fenced-blocks.png)](</File:cudatext-fenced-blocks.png>) [](</File:cudatext-fenced-blocks.png> "Enlarge")Fenced code blocks
851+---
852+
853+This is the feature of Markdown syntax: fenced code blocks. Blocks begin with:
854+
855+ * start of line
856+ * optional spaces
857+ * 3 or more backtick-chars (also tilde-chars are allowed)
858+ * optional spaces
859+ * lexer alias like "cpp" or "cs"
860+ * optional spaces
861+ * end of line.
862+
863+Blocks end with:
864+
865+ * start of line
866+ * optional spaces
867+ * 3 or more backtick-chars (also tilde-chars are allowed)
868+ * optional spaces
869+ * end of line.
870+
871+The beginning and ending sequences are tokenized as single token.
872+
873+CudaText has the file which lists the supported lexer aliases: data/lexlib/aliases.ini. The file was compiled from [this document](<https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md>). Lexer alias will be resolved to the actual lexer name, only if that lexer is installed, otherwise you won't see an error, but block will not be syntax-highlighted.
874+
875+**Limitations:**
876+
877+ * Markdown standard tells that the beginning backticks must match the ending backticks, it must be the same amount of backticks. (And the same is valid for tildes.) This is currently not supported in CudaText.
878+ * Python Markdown description tells that the lexer alias may be replaced with the curly-brackets construct like "{ .lang }" or "{ .lang .foo .bar }" or even "{ #someid .lang .foo .bar }". This is currently not supported in CudaText.
879+ * The similar feature of the reStructuredText, as [documented here](<https://pandemic-overview.readthedocs.io/en/latest/myGuides/reStructuredText-Source-Code.html>), is not supported.
880+
881+**Note about SQL blocks.**
882+
883+CudaText has lexer preinstalled, it's lite lexer "SQL ^", and it cannot be used here, because lite lexer cannot be called from normal lexer. But you can install (from "Plugins / Addons Manager") normal lexers: SQL; T-SQL (T-SQL has it's own alias "tsql"). Just install one of them, and it will be used for SQL blocks.
884+
885+**Note about Typst lexer.**
886+
887+This lexer also supports fenced code blocks but it has its own independent rules of sub-lexers. It means Typst lexer does not rely on CudaText special code to search for sub-lexers. It has own rules. For example, for sub-lexer 'Bash script', Typst has such RegEx to search for block beginning:
888+```
889+`{3,}(shell-script|sh|bash|zsh)\b
890+```
891+
892+and such RegEx to search for block ending:
893+```
894+`{3,}(?!\w)
895+```
896+
897+## Dynamic highlight
898+
899+[![](/wiki-images/f/f8/cudatext-dynamic-hi.png)](</File:cudatext-dynamic-hi.png>) [](</File:cudatext-dynamic-hi.png> "Enlarge")Dynamic highlighting for HTML/XML/Lua
900+---
901+
902+Dynamic highlight is controlled by option "dynamic_highlight". Option allows the caret-dependant highlighting only in documents which have not more than N (option value) lines. This limitation is useful because dynamic highlight makes lexer parsing slower.
903+
904+Feature enables to highlight some 'tokens' dynamically (with default greenish background color), when caret changes position. It works only when lexer is configured to use this feature. These lexers in the CudaText distro use it:
905+
906+ * HTML, PHP, XML: opening tag and corresponding closing tag are highlighted, when caret is over one of them
907+ * CSS: rule highlights {} block with different background color, when caret is inside that block
908+ * Bash: block edge tokens are highlighted when caret is inside the block: 'if'/'fi', 'case'/'esac', 'do'/'done'
909+ * Lua: block edge tokens are highlighted when caret is inside the block: 'function'/'end', 'if'/'end', 'do'/'end'
910+
911+**Examples:**
912+
913+ * On the HTML example editor, 2 fragments have dynamic highlighting (because of 2 multi-carets). First caret is placed inside tag 'h1' but before tag 'a'. Second caret is placed inside tag 'a'. So second caret enables dynamic highlight of angle brackets too, not only of a tag.
914+ * On the XML example editor, lexer highligts 'data' tag, surrounding the caret.
915+ * On the Lua example editor, lexer highlights 2 nested blocks, surrounding the caret: function/end and do/end.
916+
917+In the old times, dynamic highlight was also utilized in Pascal lexer to highlight tokens 'begin'/'end' when caret is inside the block. Later Pascal lexer was simplified and setting was removed. Few other lexers from Addons Manager also utilize this feature.
918+
919+It is possible to detect if some lexer utilizes this feature. Look inside LexerName.lcf file, find there "DynHighlight" parameter. Two typical configurations allow dynamic highlight:
920+
921+HTML, PHP, Lua:
922+```
923+DynHighlight = dhBound
924+ HighlightPos = cpRange
925+```
926+
927+CSS:
928+```
929+DynHighlight = dhRange
930+ HighlightPos = cpRange
931+```
932+
933+## Folding
934+
935+[![](/wiki-images/4/4b/cudatext-folding-gutter-ctx-menu.png)](</File:cudatext-folding-gutter-ctx-menu.png>) [](</File:cudatext-folding-gutter-ctx-menu.png> "Enlarge")Code folding context menu, accessed from the gutter
936+---
937+
938+"Folding" is the feature allowing to collapse (ie fold) multi-line blocks of code. Collapsed block usually shows the rectangle-like mark on the first line, and other block lines become fully hidden. Collapsed block can start from any column, but it consumes entire next lines. App shows special column in the "gutter" (vertical band with line numbers), with plus/minus icons - click on these icons collapses/uncollapses the corresponding block. Folding rules, about what blocks can be folded, are configured in the lexer file.
939+
940+There are several options to customize related functionality: to find them all, call menu item "Plugins / Options Editor Lite" and enter the dialog filter string "fold".
941+
942+Folded blocks can be shown in few different ways, see the option "fold_style":
943+
944+ * rectangle-mark at the beginning of the range (maybe after some text in the line)
945+ * rectangle-mark after the end of the first line of the range
946+ * "− − −" dashed line below the first line of the range
947+
948+Clicks on the first partially folded line:
949+
950+ * Click on the rectangle-mark does not unfold the block, because double-click must be handled. Double-click on the rectangle-mark selects the entire block (even if it's folded and user cannot see the selection).
951+ * When option "fold_style" has value 0 to 2, clicking of the first partially folded line (out of rectangle-mark) unfolds the block. When "fold_style" has another value, click does not unfold the block, and user can mouse-select some part of the line.
952+
953+To select an entire folded block by keyboard, place the caret right before the beginning of the block, and press Shift+Down. Ie, make selection to the beginning of the next _unfolded_ line.
954+
955+### Gutter folding right-click menu
956+
957+Gutter's folding band supports right-click menu. It gives commands to fold/unfold all blocks which touch the right-clicked editor line. When it can be useful? For example, you have JSON file with line:
958+```
959+"data": [{
960+```
961+
962+Here you have outer block (square brackets) with inner block (curly brackets). Click on folding icon will fold the outer block. What if you want to fold the inner block? Right-click on gutter's folding band, and you will see the popup menu with menu items:
963+```
964+Line 6: "data": [{
965+ Line 6: "data": [{
966+```
967+
968+Clicking the first item will fold/unfold the outer block, clicking the second item will fold/unfold the inner block.
969+
970+### Excluding of last line from folding
971+
972+Lexer JSON has special behaviour of folding, for such situations:
973+```
974+[
975+ {
976+ 1: 2
977+ }, {
978+ 3: 4
979+ }, {
980+ 5: 6
981+ }
982+ ]
983+```
984+
985+Try to fold first 2 blocks in this example. You see that last line of block is excluded from folding, it is a feature.
986+
987+Auto-excluding of last line works automatically. But for rare cases, it is needed to disable it. For example, Rainmeter lexer: its folding rules fits the criteria of last line excluding, but it is bad for the user. So last line excluding must be disabled manually for Rainmeter lexer. Setting exists in the file "data/lexlib/*.cuda-lexmap":
988+```
989+[op]
990+ fold_exclude_line=0
991+```
992+
993+### Automatic folding of comments
994+
995+[![](/wiki-images/3/3e/cudatext-fold-comments.png)](</File:cudatext-fold-comments.png>) [](</File:cudatext-fold-comments.png> "Enlarge")Auto-folding of comments
996+---
997+
998+There is an option "auto_fold_comments" (default is 0 - it's turned off) which allows to automatically create folding ranges from N (or more) consecutive lines, which are all "syntax comments" and/or "syntax strings". This works for both line-comments and stream-comments, they can be even mixed (one comment after another without blank lines in between, but not for several stream-comments on a single line). This works for multi-line string literals and for single-line string literals (single-line literals can go one after another without symbols in between, which is rarely supported by languages, but it occurs sometimes).
999+
1000+Which lexer literals are "comment"/"string"? This is setting of lexer, it is stored in the data/lexlib/*.cuda-lexmap file like this:
1001+```
1002+[comments]
1003+ styles_cmt=Comment,Comment doc
1004+ styles_str=Text,Tag string
1005+```
1006+
1007+There is also per-lexer setting to disable auto-folding for lexer, in the file "data/lexlib/*.cuda-lexmap":
1008+```
1009+[op]
1010+ auto_fold=0
1011+```
1012+
1013+This setting is present for lexers:
1014+
1015+ * Markdown
1016+ * reStructuredText
1017+ * MediaWiki
1018+ * WikidPad
1019+ * Textile
1020+
1021+ie for all lexers which support built-in Pascal tree-helpers. Because Pascal tree-helpers make folding ranges which conflict with auto-folding ranges.
1022+
1023+## Encodings
1024+
1025+You can change encoding of document by clicking on statusbar item, or by using menu "File / Encoding". Menu will give list of encodings. Menu gives 2 sub-menus:
1026+
1027+ * "Reload as": Reload file in given encoding from disk.
1028+ * "Convert to": Change encoding in memory only (this doesn't save the file).
1029+
1030+Possible encoding names for command-line usage:
1031+
1032+ * utf8
1033+ * utf8_bom
1034+ * utf16le
1035+ * utf16le_bom
1036+ * utf16be
1037+ * utf16be_bom
1038+ * utf32le
1039+ * utf32le_bom
1040+ * utf32be
1041+ * utf32be_bom
1042+ * cp1250
1043+ * cp1251
1044+ * cp1252
1045+ * cp1253
1046+ * cp1254
1047+ * cp1255
1048+ * cp1256
1049+ * cp1257
1050+ * cp1258
1051+
1052+ * cp437
1053+ * cp850
1054+ * cp852
1055+ * cp861
1056+ * cp865
1057+ * cp866
1058+ * cp874
1059+ * shift-jis
1060+ * gbk
1061+ * cns
1062+ * uhc
1063+ * big5
1064+ * gb2312
1065+ * euc-kr
1066+
1067+ * iso-8859-1
1068+ * iso-8859-2
1069+ * iso-8859-3
1070+ * iso-8859-4
1071+ * iso-8859-5
1072+ * iso-8859-7
1073+ * iso-8859-9
1074+ * iso-8859-10
1075+ * iso-8859-13
1076+ * iso-8859-14
1077+ * iso-8859-15
1078+ * iso-8859-16
1079+ * mac
1080+ * koi8r
1081+ * koi8u
1082+ * koi8ru
1083+
1084+## Line ends
1085+
1086+All major types of line-ends are supported:
1087+
1088+ * CR LF (usual for Windows)
1089+ * LF (usual for Linux and Unix)
1090+ * CR (usual for Mac OS 9, now almost not used)
1091+
1092+Mixed line-ends (LF with CR with CR LF) in one document are supported. Because of this feature, CudaText saves binary files to disk without corrupting them. To see mixed line-ends, use application option "unprinted_content", which can show text marks ("lf" etc) at line-ends.
1093+
1094+Commands:
1095+
1096+ * To change line-ends for all lines in the current document, click statusbar cell for line-ends, menu will appear. You need to save file then. Changed line-ends can be undone via "Undo". Also 3 commands are available in the Command Palette.
1097+ * To change line-ends for individial lines, use 3 commands in the Command Palette: "change line ends, for line(s) with caret: CR LF / LF / CR".
1098+
1099+# Additional indentation on Enter
1100+
1101+Some languages need that after pressing Enter, you make the additional indentation on the next line. For example, Python: it needs additional indentation after "def name():" and in some other cases. CudaText solves this via option "indent_auto_rule". Option must contain the regular expression which will be tested against the line on which you press Enter. CudaText ships predefined setting "indent_auto_rule" for several lexers: look at files "settings_default/lexer *.json".
1102+
1103+Example for Nim lexer. It needs indentation when you press Enter on a line ending with "=" or ":". And on a line with keywords "let", "var", "import". So write to the lexer-specific config "settings/lexer Nim.json":
1104+```
1105+{
1106+ "indent_auto_rule": "^\\s*(let|var|import)$|.+[=:]$",
1107+ }
1108+```
1109+
1110+Note for C-like lexers. Pressing Enter when caret is inside {} brackets (just after the brackets auto-pairing) - this is handled by CudaText specially, no option is needed here.
1111+
1112+# Groups of tabs
1113+
1114+"Groups" are sets of ui-tabs, where each ui-tab has attached editor control. By default only the first group is shown. Totally 6 "fixed" groups (located in the main app window) + 3 "floating" groups can be shown. Menu item "Split" allows to choose grouping mode:
1115+
1116+ * One group
1117+ * 2 groups: vertically or horizontally
1118+ * 3 groups: vertically, horizontally or 1+2
1119+ * 4 groups: vertically, horizontally or grid
1120+ * 6 groups: vertically, horizontally or grid
1121+
1122+First group cannot be empty, at least one tab exists in it. Other groups can be empty: on closing last tab, if it's active, the first group activates.
1123+
1124+ * You can drag-drop tabs from any group to any other visible group (drop only on tabs area).
1125+ * You can move tabs to other groups (by group number or to the next/previous), using commands in tab headers context menu.
1126+ * In grouping modes "2 groups" and "1+2" there's a context menu for splitter, to choose splitting 50/50, 40/60 etc.
1127+ * On changing grouping mode, tabs from disappearing group(s) are moved to still visible group.
1128+
1129+3 "floating" groups are available, besides 6 "fixed" groups, they are inside separate windows (so can be moved to separate monitor). To move some ui-tab to floating group, call context menu over ui-tab title, choose menu item "Move tab to group / Floating n" (n = 1, 2, 3).
1130+
1131+If a "floating" group is focused, you should not click main window's menu items to perform commands. Instead, call commands by hotkeys. By clicking on the main window (for example: on the code-tree, when code-tree is in the main window), you move the focus to the "fixed" group and editor command will execute for the "fixed" group.
1132+
1133+# Auto-completion
1134+
1135+Command "auto-completion menu" (default hotkey: Ctrl+Space) shows auto-completion listbox.
1136+
1137+Command "go to definition" (default activation: see #Mouse_shortcuts), jumps to the declaration of the identifier under first caret.
1138+
1139+"Go to definition" and "auto-completion menu" require installed plugin (for example, "LSP Client" with configuration file "settings/lsp_xxxx.json"). If you did not install plugin yet - "go to defintion" does nothing, showing the error "No goto-definition plugin installed for this lexer" in the bottom statusbar.
1140+
1141+## IntelliSense
1142+
1143+Intelligent completion is supported via plugins. For the 2021 year, such plugins exist:
1144+
1145+ * [[CudaText plugins|LSP Client]] \- supports Microsoft LSP protocol, for lot of languages. Plugin was tested to work good with servers: Python, C++, C#, CSS/SCSS/LESS, JavaScript/TypeScript, Go, Rust.
1146+
1147+And specialized plugins:
1148+
1149+ * for Python lexer - "Python IntelliSense"
1150+ * for HTML lexer - "HTML Completion", gives additional completion for "id" and "class" names
1151+ * for AutoIt lexer - "AutoIt Helper"
1152+ * for SPIR lexer - "SPIR Helper"
1153+
1154+In the case of files without lexer, consider to use plugins "Complete From Text" and "Intext Complete". They suggest completions from all words from the current document (or all opened documents, by option).
1155+
1156+## Static auto-completion files
1157+
1158+Some lexers (e.g. PHP, Pascal, Clojure) provide .acp files, which are fixed set of special words, to show in completion listbox. This is very simple completion, which ignores current context, it only suggests matching strings for the word (or string) under caret. These .acp files are stored in the folder "data/autocomplete".
1159+
1160+## Special HTML auto-completion
1161+
1162+Lexer HTML (and lexers with "HTML" in name, see the option "autocomplete_html_lexers") has its special logic, which is built-in in CudaText. It uses data files in the folder "data/autocompletespec" plus built-in code.
1163+
1164+Note: what is "tag", "attribute", "value" below? HTML lines has the form like:
1165+```
1166+<tag attribute1="value1" attribute2="value2" ...> some text </tag>
1167+```
1168+
1169+Completion listbox shows different information depending on context:
1170+
1171+ * Caret is on empty space or after "<". Listbox shows list of tags.
1172+ * Caret is on tag name (opening or closing). Listbox shows list of tags (beginning with typed tag).
1173+ * Caret is after opening tag, before closing bracket, on empty space. Listbox shows list of tag's attributes.
1174+ * Caret is on tag's attribute, before "=". Listbox shows list of attributes (beginning with typed attribute).
1175+ * Caret is after tag's attribute, after "=". Listbox shows list of possible values of attribute, for fixed set of values.
1176+ * Caret is inside attribute's quoted value. Possible cases:
1177+ * Some tag/attribute with fixed set of values. Listbox shows list of possible values (beginning with typed value).
1178+ * Tag A, attribute HREF. Listbox shows list of folders and all files (all files can be hyper-linked).
1179+ * Tag LINK, attribute HREF. Listbox shows list of folders and CSS files.
1180+ * Tag SCRIPT, attribute SRC. Listbox shows list of folders and JS files.
1181+ * Tag IMG/INPUT, attribute SRC. Listbox shows list of folders and picture files.
1182+ * Tag FRAME/IFRAME, attribute SRC. Listbox shows list of folders and HTML/PHP/ASP files.
1183+ * Tag AUDIO, attribute SRC. Listbox shows list of folders and audio files (HTML supports few extensions).
1184+ * Tag VIDEO, attribute SRC. Listbox shows list of folders and video files (HTML supports few extensions).
1185+ * Tag SOURCE, attribute SRC. Listbox shows list of folders and audio+video files (code doesn't detect the outer tag: audio, video etc).
1186+ * Caret is after '&' char with optional word-chars after '&'. Listbox shows HTML entities.
1187+
1188+[![cudatext-complete-pics.png](/wiki-images/e/e1/cudatext-complete-pics.png)](</File:cudatext-complete-pics.png>)
1189+
1190+About folders/filenames completion. Listbox items list depends on part of the quoted value before the caret. Folder/file names are taken from the folder/subfolder/up-folder of the current editor's document. Some examples, where caret is shown as "|".
1191+
1192+ * Value "|end": All filenames.
1193+ * Value "ab|end": Filenames beginning with "ab".
1194+ * Value "bar/foo/|end": All filenames, from subfolder "bar/foo".
1195+ * Value "../foo/bar/ab|end": Filenames beginning with "ab", from relative folder "../foo/bar".
1196+
1197+[![cudatext-complete-filenames.png](/wiki-images/9/9a/cudatext-complete-filenames.png)](</File:cudatext-complete-filenames.png>)
1198+
1199+To use auto-completion of CLASS= and ID= names (ie suggest mentioned names for partially typed names), you need the plugin "HTML Completion".
1200+
1201+## Special CSS auto-completion
1202+
1203+Lexer CSS (see the option "autocomplete_css_lexers") has its special logic, which is built-in CudaText. It uses data files in the folder "data/autocompletespec". Several possible cases are handled:
1204+
1205+1) Caret is inside {} brackets:
1206+
1207+ * Caret is on CSS property name. Listbox shows list of properties (beginning with the typed value).
1208+ * Caret is after CSS property and ":". If that CSS property has fixed set of values, listbox shows list of those values (beginning with the typed value).
1209+ * Special case is "custom CSS properties", which start with double dashes, like "--my-var1". App supports completion of these names, when caret in inside "var()" function. App searches for all custom properties names mentioned in the current document.
1210+
1211+2) Caret is outside of {} brackets:
1212+
1213+ * Caret is after tag name with char "@". Listbox shows list of CSS at-rules.
1214+ * Caret is after tag name with char ":". Listbox shows list of CSS pseudo-elements, beginning with ":" and "::".
1215+
1216+3) Caret is in URL specifier (which is used to specify relative filename of a picture):
1217+```
1218+url(path|)
1219+ url("path|")
1220+ url('path|')
1221+```
1222+
1223+Listbox shows folder/file names, if "path" lefter than the caret contains valid partial path. Slashes must be forward ones. For example, url("./|") shows folders/files from the document's folder. For example, url("subdir/|") shows files/folders from the subfolder "subdir".
1224+
1225+## File URI auto-completion
1226+
1227+File URI is file path in the form like 'file://localhost/dir/filename' or 'file:///dir/filename' (host name 'localhost' is often missed). On Windows URI can look like 'file:///c:/dir/filename'.
1228+
1229+CudaText supports auto-completion for file URIs, when caret is on 'dir/filename' part, and file path exists on local user's PC.
1230+
1231+[![cudatext-complete-fileuri.png](/wiki-images/1/1a/cudatext-complete-fileuri.png)](</File:cudatext-complete-fileuri.png>)
1232+
1233+Auto-completion behaviour for this case is described in the topic about HTML completion, see "folders/filenames completion".
1234+
1235+# Code-Tree
1236+
1237+Code-tree is treeview UI control which shows list of document's 'symbols': classes/functions/structs/etc, from the lexer (only if lexer supports this). To show code-tree, activate the side-panel (default hotkey: F12). Many lexers support code-tree: most C-based, HTML, XML, CSS, JS etc. Example of tree for Pascal:
1238+
1239+[![atsynedit tree.png](/wiki-images/f/f8/atsynedit_tree.png)](</File:atsynedit_tree.png>)
1240+
1241+ * Double-click on a tree node moves caret to its text.
1242+ * Tree is filled after few seconds after file opening (search for options ui_tree* to change this pause).
1243+ * When you move caret, tree shows tree node for caret position, after a pause (search for options ui_tree* to change this).
1244+
1245+Code-tree has the "filter" input field: when not empty, code-tree shows only items containing the filter text. This field also supports filtering by few **space-separated words**. There is also **Shift+Enter hotkey** in the filter field: it adds current filter string to the drop-down combobox history. Last entered filter strings are saved/restored to/from sessions.
1246+
1247+Code-tree has the context menu with items:
1248+
1249+ * "Fold all"
1250+ * "Unfold all"
1251+ * "Fold level", 2 to 9
1252+ * "Sorted": to toggle the alphabetical sorted mode of the tree
1253+
1254+Code-tree for CSS lexer has additional feature: in the "Colors" node, it shows colored preview-squares for HTML color-tokens - #AABBCC / #ABC / rgb(...) / rgba(...) / hsl(...) / hsla(...).
1255+
1256+[![cudatext-tree-css-colors.png](/wiki-images/d/d4/cudatext-tree-css-colors.png)](</File:cudatext-tree-css-colors.png>)
1257+
1258+# Console panel
1259+
1260+Panel is called by key Ctrl+tilde (Ctrl+`). It has read-only memo with output and edit field. You can type Python commands in the edit field, they will run and show output in the memo. E.g. enter "print(10+12)" and you'll see output "22". Can enter complex commands: e.g. "for i in range(10): print(i)".
1261+
1262+[![cudatext-console.png](/wiki-images/b/b2/cudatext-console.png)](</File:cudatext-console.png>)
1263+
1264+ * If you enter command beginning with "=", then it's the same as you enterted "print()". E.g. command "=10+12" will give "22".
1265+ * If you end command with ";", it won't be added to dropdown history.
1266+ * Double-click on memo lines:
1267+ * If line starts with ">>>", it repeats the old command (after ">>>" symbols).
1268+ * For other lines, it runs "Navigate" context-menu command.
1269+
1270+You can enter commands from CudaText API. Example clears all bookmarks and sets bookmark on line 11 (these are several commands, run one by one):
1271+```
1272+from cudatext import *
1273+ ed.bookmark(BOOKMARK_CLEAR_ALL, 0)
1274+ ed.bookmark(BOOKMARK_SET, 10)
1275+```
1276+
1277+## How to use Console as calculator
1278+
1279+Call Console panel with Ctrl+` (Ctrl+tilde). In its input field, enter valid Python expressions with leading "=" char. To use "sin", "cos", "pi" etc, first enter command "from math import *".
1280+
1281+Example of 3 entered lines and their log in console:
1282+```
1283+>>> from math import *
1284+ >>> =pi
1285+ 3.141592653589793
1286+ >>> =100/5+2
1287+ 22.0
1288+```
1289+
1290+# Command Palette
1291+
1292+Command Palette is a dialog which shows all embedded and external (plugin) commands in a single list. To call it, use hotkey Ctrl+Shift+P (or alias hotkey F1). To configure hotkey for some command in Palette, focus this command in listbox and press F9 - additional dialog will appear. CudaText remembers last chosen listbox item in the history file.
1293+
1294+Command Palette (and menu-like dialog in Python API) has the filter field. Filter supports fuzzy search, if the option "ui_listbox_fuzzy" is on. "Fuzzy" means that filter leaves only those listbox items, which contain all filter chars in ascending order. Example of fuzzy matches:
1295+
1296+ * "fop" matches "file: open file"
1297+ * "gttb" matches "goto text begin"
1298+
1299+If option is off, filter uses normal search. "Normal" means that filter leaves only those listbox items, which contain all words from the filter (in any order).
1300+
1301+Filter field can find hotkeys too. Enter only hotkey substring, with first "@" char. E.g. "@ho" finds "Ctrl+Home". This search is not fuzzy.
1302+
1303+Command Palette lists all internal CudaText commands, all plugin commands (prefixed with "plugin:"), all lexers (prefixed with "lexer:"), and currently opened files (prefixed with "opened file:"). Filter field allows to type hash symbol "#" followed by a letter, to make filtering by category:
1304+
1305+ * #p - plugins
1306+ * #l - lexers
1307+ * #f - opened files
1308+ * #r - recently used files
1309+
1310+You can type those "hash tags" at begin or end of the field, even without separating space. E.g. "bar#p" will show only plugin commands containing "bar", "#f.md" will show only Markdown files (with .md extension).
1311+
1312+# Regular expressions
1313+
1314+Lexer parser uses EControl regex engine. You use this regex syntax only in the "Lexer Properties" dialog in SynWrite, not in the CudaText normal usage. EControl regex has custom features:
1315+
1316+ * class \A: begin of the document
1317+ * class \Z: end of the document
1318+ * class \l: Unicode word-char except the underscore char
1319+ * class \L: inversion to \l
1320+ * lookahead/lookbehind can find match of variable length
1321+ * modifier (?r): \w catches all Unicode letters too
1322+ * modifier (?g): greedy
1323+
1324+CudaText search/replace uses [TRegExpr engine](<https://regex.sorokin.engineer/en/latest/regular_expressions.html>) (by Sorokin, later improved by Alexey Torgashin).
1325+
1326+ * To refer to regex groups in the regular expression itself, in the "Find what" field, use syntax \1 ... \9 and \0 for entire match.
1327+ * To perform replacements with groups, in the "Replace with" field, use syntax $1 ... $9 and $0 for entire match. To use group 1 with following "00", use this: ${1}00.
1328+
1329+## Change case on replaces
1330+
1331+With regex, you can change case of found fragments, use modifiers in replace-with field:
1332+
1333+ * \l - First char to lower
1334+ * \L - All chars to lower
1335+ * \u - First char to upper
1336+ * \U - All chars to upper
1337+
1338+E.g. if found a word, use replace-with field "\L$0" to change word to lowercase (here $0 is group 0, found text).
1339+
1340+Modifiers affect only element after them, element is:
1341+
1342+ * one char (not string), so "\Uabc" and "\uabc" give same result "Abc" (only one char changed),
1343+ * or group $0 ... $9, so modifier changes case of this group (not only one char).
1344+
1345+# Output/Validate panels
1346+
1347+Output and Validate panels are embedded in the bottom panel, they can be shown by clicking their icons in the lower part of the sidebar. These panels allow to highlight (e.g. in blue) lines which match some RegEx. RegEx must be set by plugins which need that.
1348+
1349+ * Plugin "External Tools" highlights the resulting lines in the Output panel, by setting the RegEx from the user tool's properties.
1350+ * Plugin "HTML Tidy" uses Validate panel and sets RegEx for HTML Tidy resulting lines.
1351+
1352+Double-click is reserved in the Output/Validate panels - it is busy here for navigation from the clicked position to the source code. For example, "External Tools" plugin tries to perform this navigation when you double-click lines (even not highlighted lines).
1353+
1354+These panels have hotkeys:
1355+
1356+ * Up/Down/PgUp/PgDown/Home/End: Move selection in list
1357+ * Enter: Try to navigate to source file, like double-click
1358+ * Esc: Focus the editor
1359+ * Ctrl+Del: Clear the entire list
1360+ * Ctrl+C: Copy to clipboard entire list
1361+ * Ctrl+D: Copy to clipboard selected line
1362+
1363+# Dialog Find/Replace
1364+
1365+Find/Replace dialog has hotkeys, which work only when this dialog is focused. Hotkeys can be customized via options "find_hotkey_xxxx".
1366+
1367+ * Alt+Enter: Find first
1368+ * Enter: Find next / Replace next (depends of focused input)
1369+ * Shift+Enter: Find previous
1370+ * Ctrl+Enter: Add new line in multi-line input (multi-line mode is activated by "+" button)
1371+ * Ctrl+Alt+Z: Replace and find next
1372+ * Ctrl+Alt+Shift+Z: Replace and don't find next
1373+ * Ctrl+Alt+A: Replace all occurrences
1374+ * Ctrl+Alt+O: Count all occurrences
1375+ * Ctrl+Alt+E: Select all occurrences
1376+ * Ctrl+Alt+K: Mark all occurrences (with markers)
1377+ * Ctrl+Alt+Q: Extract all RegEx matches
1378+ * and hotkeys to toggle search/replace options (case sensitive, reg.ex., whole words etc)
1379+ * additional not customizable hotkey Ctrl+Down: when input field (find-what or replace-with) is focused, hotkey copies the "find-what" text to "replace-with".
1380+
1381+[![cudatext-find-dlg.png](/wiki-images/2/2c/cudatext-find-dlg.png)](</File:cudatext-find-dlg.png>)
1382+
1383+Toggle-buttons have hotkeys too. Hover mouse over them to see floating tooltips about button functions.
1384+
1385+Toggle-buttons, ie options, are:
1386+
1387+Toggle-button ".*"
1388+ Use "regular expressions" engine.
1389+Toggle-button "aA"
1390+ Case sensitive search: "a" will be different from "A".
1391+Toggle-button "w"
1392+ Search for whole words only, ie both sides of found match must be "word boundaries".
1393+Toggle-button "O"
1394+ Wrapped search: search from beginning after reaching the end (with forward search), and search from end after reaching the beginning (with backward search).
1395+Toggle-button "[..]"
1396+ Search in selection only.
1397+Toggle-button "+"
1398+ Toggle multi-line mode for both dialog input fields. To add a newline in multi-line fields, press Ctrl+Enter.
1399+Toggle-button "*"
1400+ Choose allowed syntax elements: Any / Only comments / Only strings / Only comments+strings / etc. This feature must be supported by lexer (and some lexers are limited, support only "comments" or only "strings" syntax elements). Syntax element is detected from left edge position of a found match.
1401+Toggle-button "Hi"
1402+ Highlight all matches for the current search options. Matches are highlighted in the current editor, with the rounded borders, using the color of "SeparLine" syntax theme item. Editor auto-scrolls to the first found match (pretty much like ST3 editor). The limitation of this feature: a highlighted match has the single font color for the entire match, so if a match lays over several syntax tokens (e.g. number, dot, normal word), the entire match will have the single font color anyway.
1403+Toggle-button "Im"
1404+ Immediate search, ie find-as-you-type. When checked, each typing in the "Find what" field finds next match in the editor (or the first match, if input was empty before typing).
1405+
1406+Toggle-buttons for "replace" mode:
1407+
1408+Toggle-button "?!"
1409+ Show confirmation on each replace.
1410+Toggle-button "$0"
1411+ "RegEx substitute for 'Replace with'". Activates "substitute" for replace-action. When option is off, the replate-with field is taken literally, without interpreting special constructs. When option is on, the replace-with field is processed for special constructs:
1412+
1413+ * $0: Text of the whole found match
1414+ * $1 ... $9: Text of the found RegEx group with the index 1...9
1415+ * \n: NL char
1416+ * \r: CR char
1417+ * \t: TAB char
1418+ * \f: FF char
1419+ * \a: BEL char
1420+ * \e: ESC char
1421+ * \xNN, \x{NNNN}: hex code of char
1422+ * \l: lower case of one char
1423+ * \L: lower case of all text
1424+ * \u: upper case of one char
1425+ * \U: upper case of all text
1426+
1427+Toggle-button "AB"
1428+ Preserve case on replacement. Mimics logic in VS Code program:
1429+
1430+ * If the original string contains only upper-case or only lower-case characters, the result will be either all upper-case or all lower-case characters:
1431+ * "ABCDE" -> replace with "xyz" -> "XYZ" (preserving all upper-case);
1432+ * "abcde" -> replace with "xYz" -> "xyz" (preserving all lower-case).
1433+ * The case of the first character in the original string is always preserved:
1434+ * if it is upper-case, the first character in the result will be upper-case;
1435+ * if it is lower-case, the first character in the result will be lower-case.
1436+ * "Abcde" -> replace with "xyz" -> "Xyz" (preserving the first upper-case);
1437+ * "abcde" -> replace with "Xyz" -> "xyz" (preserving the first lower-case).
1438+ * In case of a mixed-case original string, the result follows the case of characters in the replacing string, excluding the very first character of the original string that always preserves its original case.
1439+ * "ABcde" -> replace with "xyZ" -> "XyZ" (preserving the first upper-case);
1440+ * "abCDE" -> replace with "XYz" -> "xYz" (preserving the first lower-case).
1441+
1442+Action buttons in dialog:
1443+
1444+Button "|<"
1445+ Starts the search from document beginning, ignoring the caret position.
1446+
1447+Button ">"
1448+ Finds next match, ie continues search forward.
1449+
1450+Button "<"
1451+ Finds previous match, ie continues search backward.
1452+
1453+Button "..."
1454+ Shows menu with additional actions:
1455+
1456+"Count all"
1457+ Count all matches and show the number in the statusbar.
1458+"Extract RegEx matches"
1459+ It's enabled only with RegEx option. Finds all matches, all found matches are put to an internal list, list is sorted, duplicates are discarded, and list is put to a new document. Plugin "Extract Strings" does the same task but using the Python RegEx engine.
1460+"Select all"
1461+ Finds all matches in a document and places multi-seletions on them.
1462+"Mark all"
1463+ Finds all matches in a document and places #Markers on them.
1464+
1465+Button "Replace"
1466+ If some fragment was found/selected already, it replaces this fragment (by contents of "Replace with" field). If not, it finds next fragment and selects it. If replacement was performed, it finds/selects the next fragment.
1467+
1468+Button "Rep all"
1469+ Performs replacement of all matches in the current document.
1470+
1471+Button "Rep global"
1472+ Performs replacement of all matches in all opened documents in all editor groups. After showing the additional confirmation.
1473+
1474+The state of dialog search options is saved to the history file (settings/history.json), and is restored after app restart.
1475+
1476+Button "..." is enabled in "editor mode", so if button is disabled for you, it means CudaText was opened in #Text/Hex viewer mode. "Viewer mode" is activated when you pass the name of huge file with size>500 Mbytes (this is controlled by option "ui_max_size_open").
1477+
1478+## Text searcher features
1479+
1480+1) Search engine supports actions with multi-selections. This makes sense mainly for mass-search actions (Find all, Select all, Mark all, Replace all).
1481+
1482+2) Search engine has the feature, which is rarely implemented in text editors. When invoked on text selection(s) with the option "Search in selection only", engine doesn't place caret+selection on found match, instead it places marker (#Markers). The marker is placed with the underline (triangle with a line to the left), which shows the length of the found match. Actions "Find next"/"Find previuos"/"Replace" support "in selection only" too, they move that mentioned marker. Note that this feature checks the presence of a single marker in text, it may not work OK if you have some markers already placed.
1483+
1484+[![cudatext-find-markers.png](/wiki-images/7/74/cudatext-find-markers.png)](</File:cudatext-find-markers.png>)
1485+
1486+3) Second click on the "Search" sidebar button toggles dialog between Find and Replace modes.
1487+
1488+4) The "Replace all" action has one important feature: when find/replace options
1489+
1490+ * regex
1491+ * whole words only
1492+ * in selection only
1493+ * allowed syntax elements
1494+ * confirm replaces
1495+ * preserve case on replacement
1496+
1497+are all Off - app uses big optimization, making it a lot faster on huge lines. For example, replace of "\r\n" with linebreak char in huge line of length 20M with 900K occurrences: time without optimization in older CudaText versions: 15 mins --> now with optimization: 7 seconds.
1498+
1499+# "Go to line" and other "Go to" dialogs
1500+
1501+**Dialog "Go to line"** (item in the "Search" menu) allows to enter text in formats:
1502+
1503+ * 10 (decimal number): Jump to given line number (to line start).
1504+ * 10:10 (two decimal numbers): Jump to given line and column numbers.
1505+ * 10% (decimal with trailing "%"): Jump to percents of total line count (to line start).
1506+ * d100 (decimal with leading "d"): Jump to absolute decimal offset.
1507+ * xFF00 (hex number with leading "x"): Jump to absolute hex offset.
1508+ * value with leading/trailing "+": Extend selection to this position. For example: if caret is at the 2:2 and you enter "4:10+", editor makes selection from 2:2 to 4:10. Entering "4+" makes selection until start of line 4.
1509+
1510+Also it is possible to call "Go to line" dialog by clicking the statusbar's "caret information" cell (it is the first cell by default).
1511+
1512+**Other "Go to" dialogs.**
1513+
1514+1) Menu item "Search / Go to bookmark". Shows list of all bookmarks, in all opened documents, allows to jump to chosen bookmark.
1515+
1516+2) Project Manager plugin. Menu item "Plugins / Project Manager / Go to file". Shows list of all files in the current project, allows to jump to chosen file in the Project treeview. If option is enabled in the Project Manager, command will also open the chosen file in the editor.
1517+
1518+3) In the "Command Palette" dialog, enter #-char, and tooltip will appear in the Command Palette lower part. It tells how to call via Command Palette:
1519+
1520+ * List of all opened documents with filenames.
1521+ * List of recently opened filenames.
1522+
1523+4) Plugin CudaExt. Gives the command "Code Tree: Symbols list". It shows dialog with list of all symbols from the code-tree for the current document. Note: option "lexer_folding_max_lines" limits the count of document lines, for which code-tree is created. Plugin CudaExt gives 2 additional commands for symbols list: "... (only 1 up level)", "... (only 2 up level)" - they only show symbols from 1-2 top levels of the code-tree.
1524+
1525+# Sessions
1526+
1527+"Session" is a set of opened documents, with properties of each document. CudaText sessions are stored in JSON files with ".cuda-session" extension. Default session file name is "history session.json" in the "settings" folder. CudaText shows name of current session in its window title like "filename.txt {session_name} - CudaText".
1528+
1529+CudaText has options:
1530+
1531+ * "ui_reopen_session": Save last session on closing, and restore it on start.
1532+ * "ui_reopen_session_cmdline": Allow to restore last session even if some file/folder was passed in the command line (or from the Windows Shell Extension). Note, this gives weird behaviour: N program instances will reopen the same last session + passed command-line file. So this option is mainly for the single instance mode.
1533+ * "ui_auto_save_session": On program closing, save current session without asking.
1534+
1535+If some session is opened, program stores document states, on program closing, to session file. If no session is opened, program stores document states to "history files.json" in the "settings" folder.
1536+
1537+Session file contains data:
1538+
1539+ * List of named documents (file names), and unnamed documents
1540+ * For each document:
1541+ * kind of the document: text editor / picture viewer / text viewer (and viewer mode: text/binary/hex/unicode)
1542+ * text of the document, if document is modified
1543+ * undo/redo data, if document is modified
1544+ * read-only state
1545+ * first caret position
1546+ * encoding
1547+ * word-wrap mode
1548+ * lexer
1549+ * bookmarks
1550+ * index of top visible line
1551+ * tab size and "tab as spaces" state
1552+ * minimap and micromap visible state
1553+ * ruler visible state
1554+ * non-printable characters visible state
1555+ * line numbers visible state
1556+ * scale factor
1557+ * list of folded ranges (if lexer supports folding)
1558+ * color of ui-tab (if not default)
1559+ * tab title (if not default)
1560+ * modified state
1561+ * code-tree filter string and history of last filters
1562+ * splitting to 2 editors: on/off, vertical/horizontal, percents of size
1563+ * column of vertical "margin" line, if it's not default
1564+ * For each modified document: date of modification, full document text
1565+ * Last input of "Go to" dialog for each ui-tab
1566+ * Layout:
1567+ * Layout/sizes of side panel and bottom panel
1568+ * Layout/sizes of editor groups
1569+ * Index of active editor group and active tab in each group
1570+
1571+Plugin "Session Manager" is present in Addon Manager, it gives commands to control sessions: open session file, save session, show list of recent sessions, etc. Session Manager also supports files from SynWrite, with .synw-session extension.
1572+
1573+# Char map
1574+
1575+Dialog "Char map" can be called from the "Edit" top menu. It has 2 modes:
1576+
1577+ * ANSI: Shows ANSI char codes from 0 to 255 (codes 128..255 map to different Unicode codes, this depends on active OS locale).
1578+ * Unicode: Shows almost all Unicode code points, they are divided to groups. Change active group using combobox at the bottom.
1579+
1580+Click any cell in the grid to insert this char at caret position. Or select a cell with arrow keys and press Enter.
1581+
1582+[![cudatext-charmap.png](/wiki-images/b/bb/cudatext-charmap.png)](</File:cudatext-charmap.png>)
1583+
1584+# Tab switcher
1585+
1586+CudaText has option "ui_tab_switcher_dialog", which activates modern tab switcher for Ctrl+Tab hotkey. This is dialog which allows to switch tab using visit history. For example: press Ctrl, Tab, Tab, Tab, release Ctrl: this goes 3 steps back in the visit history. Visit history is updated on tabs activation (activated tab moves to the top of history).
1587+
1588+Dialog lists documents from all tab-groups, with prefixes: "[3-1] /home/user/filename.cpp" for 1st tab in 3rd group.
1589+
1590+[![cudatext-tab-switcher.png](/wiki-images/c/c1/cudatext-tab-switcher.png)](</File:cudatext-tab-switcher.png>)
1591+
1592+Alternative way is plugin CudaExt. Plugin gives the command "Choose tab to switch to". You need to assign hotkey Ctrl+Tab to this command (hotkey will be removed from built-in tab switcher). Plugin's dialog is richer than CudaText's dialog: it allows to switch to Console/Output/Validate panels, it allows to cancel the operation.
1593+
1594+ * When plugin's switcher is called with pressed Ctrl-key, it shows the dialog.
1595+ * When plugin's switcher is called without Ctrl-key pressed, it immediately switches to previous tab.
1596+
1597+[![cudatext-tab-switcher-cudaext.png](/wiki-images/5/54/cudatext-tab-switcher-cudaext.png)](</File:cudatext-tab-switcher-cudaext.png>)
1598+
1599+Command Palette has several commands to switch current ui-tab:
1600+
1601+ * "ui: switch tab, to next": If option "ui_tab_switcher_dialog" is true, command shows menu-like dialog with suggestion to activate recent tab (using visit history). If option is off, command just activates the next ui-tab ignoring the visit history.
1602+ * "ui: switch tab, to previous": If option "ui_tab_switcher_dialog" is true, the same as above. If option is off, command just activates the previous ui-tab ignoring the visit history.
1603+ * "ui: switch tab, simply to next": Activates the next ui-tab, ignoring the visit history. (It considers only visual order of ui-tabs).
1604+ * "ui: switch tab, simply to previous": Like above but in reverse order.
1605+ * "ui: switch tab, to recent": Activates the ui-tab previously activated in visit history.
1606+
1607+# Minimap
1608+
1609+Minimap is wide vertical bar near editor's right side (it can be shown on the left side too, by option). To show it:
1610+
1611+ * Set the option "minimap_show" (show permamently)
1612+ * Use menu item "View / Toggle minimap" (show temporary, for the current document only)
1613+
1614+If you drag mouse over minimap, editor will scroll entirely from top to bottom, even for huge documents (mimics Sublime Text behaviour). Text in minimap is painted by pixels, not by font rendering. Minimap is scaled according to CudaText UI, but can be scaled separately too (option "minimap_scale"). Screenshot shows 2 windows with different minimap scale.
1615+
1616+[![cudatext-minimap.png](/wiki-images/3/3c/cudatext-minimap.png)](</File:cudatext-minimap.png>)
1617+
1618+CudaText UI-theme doesn't have separate color for minimap slider. CudaText calculates the color of slider (when slider is hovered by mouse): if text background color is light - slider color is darker by 5-10% (there is no option); if text background color is dark - slider color is lighter by 5-10%.
1619+
1620+Feature: for document line(s) affected by selection(s), minimap lines have additional full-width background coloring. This feature cannot be turned off yet.
1621+
1622+Feature: minimap rendering time is limited by 40 msec (no option for this yet). For rather slow CPU and maximized app window, the entire minimap rendering can take more time, so bottom minimap lines won't be colored at all.
1623+
1624+# Micromap
1625+
1626+Micromap is thin vertical bar near editor's right side. It is not scrollable, it shows overview of entire document from top to bottom. To show it:
1627+
1628+ * set option "micromap_show": to show micromap permanently for all documents.
1629+ * use menu item "View / Toggle micromap": to show micromap for the current document only.
1630+
1631+Micromap has several thin columns (from column 1 to column 3, but this can be changed by plugins) for different categories of marks. It shows:
1632+
1633+ * full-width single mark: 'thumb', ie current visible area of editor.
1634+ * on column 1 (leftmost): #Line_states marks.
1635+ * on column 2:
1636+ * marks from plugin Spell Checker (default color: reddish);
1637+ * marks from plugin Highlight Occurrences (default color: blue); mark with UI-theme color "editor, line states, changed" means that it is "Highlight Occurrences" mark which corresponds to the current caret position (only for the first caret);
1638+ * marks for bookmarks; these marks re-use UI-theme color "editor, line states, added".
1639+ * on column 3: marks for selection(s), useful for example when command "Find / Select all" makes many selections.
1640+
1641+[![cudatext-micromap .png](/wiki-images/8/8e/cudatext-micromap_.png)](</File:cudatext-micromap_.png>)
1642+
1643+Plugins can place marks on micromap, e.g. plugin "Highlight Occurrences" places marks for highlighted fragments, plugin "Spell Checker" places marks for misspelled words.
1644+
1645+Micromap can be rendered directly on the vertical scrollbar (when scrollbar is application-painted). To use that, you need 2 options:
1646+
1647+ * `"scrollbar_themed": true`
1648+ * `"micromap_on_scrollbar": true`
1649+
1650+Picture shows micromap on the scrollbar: [![cudatext-micromap-on-scrollbar.png](/wiki-images/7/72/cudatext-micromap-on-scrollbar.png)](</File:cudatext-micromap-on-scrollbar.png>)
1651+
1652+Micromap visible state is not restored from history for files, which have line count bigger than value of option "wrap_enabled_max_lines" (default is 60K lines).
1653+
1654+In rather big documents (e.g. 2000+ lines), micromap renders the horizontal line near the bottom. What is this line? This line denotes the maximal position which you can click. Space below that line is 'reserved' for the micromap 'thumb'. 'Thumb' height is limited by 16 pixels, so last 16 pixels are reserved to render the 'thumb' nicely, when you scroll to the very bottom.
1655+
1656+# Paste with middle-button-click
1657+
1658+To paste like in Linux/Unix, with middle-click, you need:
1659+
1660+ * Set option "mouse_middle_click" to value 2 (in the user.json).
1661+ * Set option "auto_copy_clp". Option supports pasting to usual editors (inside UI-tabs) and also to one-line input fields (Find/Replace, Console, Code-Tree filter).
1662+
1663+# Full-screen mode
1664+
1665+There are two menu items in the View menu:
1666+
1667+ * Toggle **Full-screen**. This maximizes app window (in a special way, OS-dependent, even OS taskbar hides), and also, optionally, turns off some UI elements: toolbar, statusbar, sidebar, side panels (Tree, Project, FTP), bottom panels (Console) etc. Option "ui_fullscreen" has set of chars, each char for one UI element to hide. E.g. option value "tp" hides 2 UI elements ("t" for toolbar, "p" for side panels).
1668+ * Toggle **Distraction-free**. Like full-screen, but also all UI elements hide (gutter, statusbar, toolbar, sidebar, side panels). No option currently to configure which elements hide.
1669+
1670+Notes:
1671+
1672+ * In the Distraction-free mode, app uses option "centering_for_distraction_free" to center the text visually. If you want this centering w/o Distraction-free mode, use the option "centering_width".
1673+ * On macOS full-screen modes hide the top menu bar. To show it w/o returning back, just move the mouse cursor to the top of the screen and hold there for few seconds.
1674+
1675+# Python integration
1676+
1677+## Python on Windows
1678+
1679+On Windows, Python engine (2022/10: currently it is 3.8) is preinstalled. CudaText finds files "python3*.dll" in its folder, and uses file with the latest version number. No options exist to change this.
1680+
1681+You can use different Python version. From CudaText's Addon Manager, install appropriate package, e.g. "Windows_Python37_64bit", and restart the program.
1682+
1683+Python engine requires Visual C++ Redistributable for Visual Studio 2015 (32-bit or 64-bit, same as CudaText). Download it from Microsoft site.
1684+
1685+So, files needed for Python 3.8 are:
1686+
1687+ * "python38.zip"
1688+ * "python3.dll"
1689+ * "python38.dll"
1690+ * "python38dlls" - folder with about 18 *.pyd files
1691+ * "vcruntime140*.dll" - Microsoft runtime
1692+
1693+File "python3.dll" without exact version: this file is sometimes needed for Python plugins to work property. For example, file is needed for plugin FTP with SFTP support (plugin crashes and shows errors in the Console if "python3.dll" is absent). Almost each package "Windows_Python3x_xxxx" contains this file.
1694+
1695+Note for Windows 7. You also need the Update for Universal C Runtime in Windows (KB2999226). Download it from the Microsoft site.
1696+
1697+## Python on Windows XP
1698+
1699+Install the package "Windows Python34 32bit". Download it from [SourceForce folder addons/packages](<https://sourceforge.net/projects/cudatext/files/addons/packages/>), and unzip to CudaText folder.
1700+
1701+No options are needed to configure this older Python, but you need to delete all newer Pythons from CudaText folder:
1702+
1703+ * python*.dll: must be deleted
1704+ * python*.zip: can be left as is
1705+ * files *.pyd: can be left as is
1706+
1707+Proper old version of "requests" is now included in the "Windows Python34 32bit". But if you miss it somehow, do additional steps:
1708+
1709+ * New versions of "requests" lib don't work, ie Addons Manager crashes. So you need to downgrade the "requests" lib. Get old version 2.5.x from <https://pypi.org/project/requests/#history> and update the folder "py/sys/requests".
1710+ * After you downgrade the "requests", you may get Addons Manager errors about HTTPS certificate. To fix that, replace outdated file "py\sys\requests\cacert.pem" with the new one from "py\sys\certifi\cacert.pem".
1711+
1712+## Python on Linux, BSD, Solaris
1713+
1714+Linux/*BSD/Solaris version uses Python library from OS. Install Python 3.x (usually already installed). Instruction, if Python library was not automatically used:
1715+
1716+ * Open file manager, go to /usr
1717+ * Search for "libpython3.*so*"
1718+
1719+Or use the terminal command:
1720+```
1721+$ find /usr -name 'libpython3.*so*' 2>/dev/null
1722+```
1723+
1724+ * If not found, install Python 3.x, and search again.
1725+ * Set option "pylib__linux" ("pylib__freebsd", "pylib__solaris") in the "user.json" config, to one of the found filenames. Write option to the "user.json" or course, not "default.json".
1726+
1727+Typical value for Ubuntu:
1728+```
1729+"pylib__linux" : "/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0",
1730+```
1731+
1732+Typical value for Solaris 11.4 x86:
1733+```
1734+"pylib__solaris" : "/usr/lib/amd64/libpython3.5m.so",
1735+```
1736+
1737+## Python on macOS
1738+
1739+On macOS you must install Python 3, from official site python.org. Versions 3.6...3.12 are OK. CudaText will detect this Python. CudaText has option "pylib__mac" with such default value (actual version number is auto-detected):
1740+```
1741+"pylib__mac": "/Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib",
1742+```
1743+
1744+macOS 15 and newer: some users report that the above path was changed to:
1745+```
1746+"pylib__mac": "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib",
1747+```
1748+
1749+If you use Homebrew to install Python on MacOS, CudaText cannot detect it, so you need to write to the "user.json" option "pylib__mac" by hands. Example:
1750+```
1751+"pylib__mac": "/usr/local/Cellar/python@3.9/3.9.1_3/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib",
1752+```
1753+
1754+If you use "virtualenv" from Anaconda with isolated Python, CudaText cannot detect it, so you need to write to the "user.json" option "pylib__mac" by hands. Example:
1755+```
1756+"pylib__mac": "/miniconda2/envs/py3/lib/libpython3.7m.dylib",
1757+```
1758+
1759+Note: Please remember to change your version in the variable string to match the version you have installed.
1760+
1761+# Line states
1762+
1763+In the gutter bar, you can see colored thin bars next to line numbers: greenish, yellowish. It is line states. They show state of lines:
1764+
1765+ * normal: they have no special color on gutter
1766+ * changed: edited since last saving
1767+ * added: newly inserted lines
1768+ * saved: previously changed/added but saved on last saving
1769+
1770+[![cudatext-line-states .png](/wiki-images/2/26/cudatext-line-states_.png)](</File:cudatext-line-states_.png>)
1771+
1772+Line states help to see which lines were edited since the last opening of a file / last saving of a file. CudaExt plugin gives few commands for line states:
1773+
1774+ * "Jump: to next/previous changed lines"
1775+ * "Jump: to next/previous working lines"
1776+ * "Jump: to next/previous saved lines"
1777+
1778+# How to change icons
1779+
1780+Screenshot shows 3 icon sets at once:
1781+
1782+ * on the main toolbar (horizontal)
1783+ * on the sidebar (vertical)
1784+ * on the Project Manager toolbar (horizontal, below "Project" text)
1785+
1786+[![cudatext all icons.png](/wiki-images/1/14/cudatext_all_icons.png)](</File:cudatext_all_icons.png>)
1787+
1788+**Icons on the main toolbar**
1789+
1790+To change them:
1791+
1792+ * (Optional) Install add-on(s) of kind "toolbar theme" (each add-on gives additional icon set or several sets).
1793+ * Change option "ui_toolbar_theme" in user.json. Option value is some subfolder in data/toolbaricons.
1794+ * Restart CudaText.
1795+
1796+Note that plugin "Options Editor Lite" makes it easy - for options "ui_toolbar_theme"/"ui_sidebar_theme"/"ui_tree_theme" it shows the combobox dropdown, which is easy to change.
1797+
1798+**Icons on the sidebar**
1799+
1800+To change them:
1801+
1802+ * (Optional) Install add-on(s) of kind "sidebar theme".
1803+ * Change option "ui_sidebar_theme" in user.json. Option value is some subfolder in data/sideicons.
1804+ * Restart CudaText.
1805+
1806+**Icons on the Project Manager toolbar**
1807+
1808+To change them:
1809+
1810+ * (Optional) Install add-on(s) of kind "proj toolbar theme".
1811+ * Change option in the dialog: "Options / Settings-plugins / Project Manager / Config".
1812+ * Restart CudaText.
1813+
1814+**Icons in the Project Manager file list**
1815+
1816+[![cudatext-project-icons.png](/wiki-images/b/bf/cudatext-project-icons.png)](</File:cudatext-project-icons.png>)
1817+
1818+To change them:
1819+
1820+ * Install add-on(s) of kind "file type icons".
1821+ * Change option in the dialog: "Options / Settings-plugins / Project Manager / Config".
1822+ * Restart CudaText.
1823+
1824+**Icons on UI-tab titles**
1825+
1826+[![cudatext-tab-icons.png](/wiki-images/9/98/cudatext-tab-icons.png)](</File:cudatext-tab-icons.png>)
1827+
1828+You must install plugin "Tab Icons" from Addons Manager. It will show icons on UI-tabs (only for known file types). Plugin also allows to set custom icons for UI-tabs. Use right-click menu over UI-tab, and menu item "Set tab icon...". This shows menu with predefined custom icons, shipped with "Tab Icons" plugin. You can add *.png 16x16 icons there too, folder is "(CudaText)/data/tabsicons" (create folder if needed).
1829+
1830+**Icons in the Code-Tree panel**
1831+
1832+[![atsynedit tree.png](/wiki-images/f/f8/atsynedit_tree.png)](</File:atsynedit_tree.png>)
1833+
1834+To change them:
1835+
1836+ * Install add-on(s) of kind "codetreeicons" (each add-on gives additional icon set).
1837+ * Change option "ui_tree_theme" in user.json. Option value is some subfolder in data/codetreeicons.
1838+ * Restart CudaText.
1839+
1840+# Toolbar
1841+
1842+CudaText has toolbar on the top, which can be shown by menu item "View / Toggle toolbar".
1843+
1844+[![cudatext-toolbar.png](/wiki-images/f/f5/cudatext-toolbar.png)](</File:cudatext-toolbar.png>)
1845+
1846+To customize it, install plugin "Config Toolbar" from Addon Manager. Plugin gives command (menu "Plugins / Config Toolbar / Customize buttons") to customize toolbar contents: simple buttons, buttons with dropdown menus, separators, icons for buttons.
1847+
1848+Plugin also gives command "Hide standard buttons" which allows to hide default CudaText buttons from toolbar. This command shows input box for space-separated indexes of buttons. What are these indexes? Indexes are 0-based numbers of all toolbar items: first button (New File) is index 0, next item (dropdown near New File) is index 1, next item (Open File) is index 2, etc (all separators also have index). So for example, to hide 3rd + 10th items, enter "2 9" into that input box.
1849+
1850+# Configurable statusbar
1851+
1852+Statusbar is fully configurable: you can change order/visibility of cells, width and alignment of cells. Option "ui_statusbar_panels" configures set of cells. Predefined cells are:
1853+
1854+ * **Carets info**. Click on it shows Go To dialog.
1855+ * **Encoding name**. Click on it shows menu to change encoding of document.
1856+ * **Line-ends characters**. Click on it shows menu to change line-ends in entire document.
1857+ * **Lexer name**. Click on it shows lexers menu.
1858+ * **Tab-char size**. Shows "Tab: 4" if Tabulation-key inserts tab-char, or "Spaces: 4" if Tabulation-key inserts spaces. Click on it shows menu:
1859+ * To change tabulation size (for the active document).
1860+ * To change mode "Tabulation-key inserts spaces".
1861+ * 2 items for actions "Convert indentation to spaces", "Convert indentation to tabs" like in Sublime Text.
1862+ * **Text insert/overwrite mode** , toggled by Ins-key. Shows "Ins" or "Ovr".
1863+ * **Mouse selection mode** : "-" for normal mode, "||" for column mode (mouse dragging makes column selection even without Alt+ key).
1864+ * **Message** from program or plugins (usually it's last auto-sized cell).
1865+ * **Word-wrapping mode**. Cell is hidden by default. Shows one of possible 3 modes:
1866+ * No wrapping.
1867+ * Wrapping at window edge.
1868+ * Wrapping at fixed margin (set it by "margin" option).
1869+ * **Font zoom value** in percents. Cell is hidden by default.
1870+
1871+The cell "carets info" shows value of one of options:
1872+
1873+ * **"ui_statusbar_no_sel"** : Used when there is no selection
1874+ * **"ui_statusbar_small_sel"** : Used when there is single-line selection
1875+ * **"ui_statusbar_str_sel"** : Used when selection is multi-line
1876+ * **"ui_statusbar_col_sel"** : Used for column-selection mode
1877+ * **"ui_statusbar_carets"** : Used when 2 or more carets are placed
1878+
1879+In the above "ui_statusbar_" options, macros are supported:
1880+
1881+ * {y}: line index of first caret
1882+ * {y2}: line index of last caret
1883+ * {yb}: line index of first selection beginning
1884+ * {ye}: line index of first selection ending
1885+ * {x}: column index of first caret, tab-chars counted as 1
1886+ * {xx}: column index of last caret, tab-chars expanded
1887+ * {count}: total number of lines
1888+ * {carets}: total number of carets
1889+ * {sel}: number of lines affected by selection(s)
1890+ * {selchars}: number of selected characters, for all kinds of selections
1891+ * {cols}: number of columns in column selection
1892+ * {char}: character at first caret (empty if no char)
1893+ * {char_dec}: character at first caret - decimal code (empty if no char)
1894+ * {char_hex}: character at first caret - 2...4-digit hex code (empty if no char)
1895+ * {char_hex4}: character at first caret - 4-digit hex code (empty if no char)
1896+ * {_ln}: localized string "Ln"
1897+ * {_col}: localized string "Col"
1898+ * {_sel}: localized string "sel"
1899+ * {_linesel}: localized string "lines sel"
1900+ * {_carets}: localized string "carets"
1901+
1902+An option exists to change the delay of messages in the statusbar.
1903+
1904+This is not used in the main statusbar, but plugin API allows to colorize statusbar cells (used by Vim Mode plugin), and to show icons there.
1905+
1906+# Text/Hex viewer
1907+
1908+CudaText has internal file viewer, for files on unlimited size. Viewer is based on different component: not ATSynEdit but ATBinHex. Viewer loads into memory only visible portion of file, so viewer is fast for files of any size. To activate the viewer for normal small text files, use these Command Palette commands:
1909+
1910+ * file: open file, in text viewer
1911+ * file: open file, in hex viewer
1912+ * file: open file, in unicode viewer
1913+ * plugin: Cuda-Ext: File: Show in hex viewer (this command is from CudaExt plugin)
1914+
1915+Viewer component supports several modes:
1916+
1917+ * Text mode: 1-byte encoding, variable line length
1918+ * Binary mode: 1-byte encoding, fixed width (line breaks are ignored)
1919+ * Hex mode: 1-byte encoding, fixed width
1920+ * Unicode mode: like Text, but in UTF-16 encoding
1921+ * Unicode/Hex mode: like Hex, but in UTF-16 encoding
1922+
1923+Combined screenshot shows the different modes in action: Text, Binary, Hex, Unicode.
1924+
1925+[![cudatext-viewer-modes.png](/wiki-images/5/5c/cudatext-viewer-modes.png)](</File:cudatext-viewer-modes.png>)
1926+
1927+CudaText suggests to use viewer for files of too big size (bigger than option "ui_max_size_open"). And for files with binary contents.
1928+
1929+[![cudatext-viewer-asking.png](/wiki-images/7/7e/cudatext-viewer-asking.png)](</File:cudatext-viewer-asking.png>)
1930+
1931+Viewer has only limited search support, ie not all Find-dialog options are enabled, when file viewer is active. Viewer allows to use "Go to" dialog. In the "Go to" dialog, you can enter "2000" to jump to hex offset 0x2000 (in hex mode, rounded to 16 bytes). If you enter "50%", viewer will jump to the middle. Viewer supports selection of block by mouse, and hotkeys Ctrl+A (Select all), Ctrl+C (Copy to clipboard). Viewer supports double-click to select whole word.
1932+
1933+In viewer mode, you can click statusbar fields:
1934+
1935+ * Encoding field. You can change viewer encoding only in non-Unicode modes.
1936+ * Mode field, to change view mode: Text, Binary, Hex, Unciode, Unicode/Hex.
1937+
1938+**Q: How to open file in viewer?**
1939+
1940+A1: If file is too big, CudaText suggests to use viewer automatically - see screenshot of the helper dialog above. If file is not too big, you can switch from the editor to viewer. You need the plugin CudaExt which gives the Command Palette command: **"Cuda-Ext: File: Show in hex viewer"**. After that, you can change viewer-mode via statusbar click: Text / Binary / Hex / etc. To switch back to the editor, use Command Palette command: **"Cuda-Ext: File: Show in text editor"**.
1941+
1942+A2: Start CudaText without any files, and call Command Palette item **"file: open file, in text viewer"**. It shows the Open File dialog and then loads file directly into viewer. Again, you can change viewer-mode via statusbar click: Text / Binary / Hex / etc.
1943+
1944+A3: Start CudaText from Terminal (console) like this:
1945+```
1946+cudatext -z=text FileName
1947+ cudatext -z=binary FileName
1948+ cudatext -z=hex FileName
1949+```
1950+
1951+# Picture file viewer
1952+
1953+CudaText has the emdedded picture file viewer. Picture mode is activated for files with several known extensions:
1954+
1955+ * BMP
1956+ * PNG
1957+ * JPEG, JPG
1958+ * GIF
1959+ * ICO (Windows icon)
1960+ * WEBP, it requires libwebp library: on Windows it is file libwebp32.dll / libwebp64.dll in the CudaText folder; on Linux/Unix it is file libwebp.so.6 in system folder
1961+ * PSD (Photoshop image)
1962+ * TGA (Targa)
1963+ * CUR (Windows cursor)
1964+
1965+Viewer supports zooming of an image:
1966+
1967+ * use Ctrl + mouse wheel
1968+ * click the statusbar cell with the zoom value, and choose one of predefined zoom values: 33%, 50%, 100%, 150%, 200%, 500%, 1000%, 1500%.
1969+
1970+While picture is zoomed so that it's bigger than the current window, you can drag the picture by mouse.
1971+
1972+While picture viewer is active, Find/Replace dialog is disabled.
1973+
1974+# Pair brackets
1975+
1976+CudaText has built-in pair bracket finder. Bracket finder can highlight pair brackets, when there is only single caret, and no selection is placed. It finds symbols "()[]{}<>" (configurable per lexer via lexer-specific configs). Bracket finder respects lexer context: it skips symbols inside syntax "comments" and syntax "strings". If caret is placed not directly on/after a bracket, program will find nearest surrounding brackets.
1977+
1978+(Long time ago, plugin "Bracket Helper" was needed for this feature, later it was removed from add-ons.)
1979+
1980+There are several options:
1981+
1982+ * "bracket_highlight"
1983+ * "bracket_symbols" (includes only symbols ()[]{} by default, but you can enable symbols <> for example in HTML lexer specific config)
1984+ * "bracket_distance"
1985+ * "auto_close_brackets"
1986+
1987+There are several commands in the Command Palette:
1988+
1989+ * brackets: pair highlight: on
1990+ * brackets: pair highlight: off
1991+ * brackets: pair highlight: toggle
1992+ * brackets: jump to pair
1993+ * brackets: select to pair
1994+ * brackets: select to pair, inside (it makes selection smaller by 2 characters)
1995+
1996+## Brackets auto-pairing logic
1997+
1998+Auto-pairing of brackets is controlled by the option "auto_close_brackets". Option supports auto-pairing of brackets and some other chars (quotes, tilde etc).
1999+
2000+**For single caret**
2001+
2002+ * If selection is present, and opening bracket is typed, CudaText encloses the selection into 2 paired chars, like "(selection)".
2003+ * If there is no selection, and char is typed (not only bracket-char, but any char from the option), CudaText inserts 2 paired chars like "()", moving the caret inside that pair. Incorrect contexts for the pairing are:
2004+ * Context "\|" - caret is after backslash.
2005+ * Context "|w" - char after caret is not one of :;.,=>.
2006+ * Context "w|" - quote-char (single quote, double quote, backtick) is typed after a word-char.
2007+ * If there is no selection, and closing bracket is typed, CudaText may ignore this char or not, it depends on context:
2008+ * Context "f(|)" - app ignores closing bracket and only moves caret righter.
2009+ * Context "f(text|)" - new closing bracket is added.
2010+
2011+**For multi-carets**
2012+
2013+CudaText first looks at contexts of all carets. If at least one caret has "not suitable" context, app does not do the pairing, for all carets. So pairing is performed for all or nothing.
2014+
2015+For caret with selection, context is considered as OK. And typed char will enclose the selection for that caret.
2016+
2017+## Auto-deletion of pair brackets
2018+
2019+BackSpace key supports deletion of both brackets at once. Only for bracket chars listed in the "bracket_symbols" option. It is supported when all carets have the 'good situation', ie this (caret is shown by "|"):
2020+```
2021+(|)
2022+ [|]
2023+ {|}
2024+```
2025+
2026+or this, with additional spaces:
2027+```
2028+(| )
2029+ [| ]
2030+ {| }
2031+```
2032+
2033+When all carets have this 'good situation', BackSpace deletes both brackets at once. When at least one caret does not have the 'good situation', BackSpace performs usual deletion of single character on the left.
2034+
2035+# Word jump commands
2036+
2037+CudaText provides several word-jump commands, see them in the Command Palette by entering "go to word":
2038+
2039+ * go to word next
2040+ * go to word next + select
2041+ * go to word next, simple
2042+ * go to word next, simple + select
2043+ * go to word previous
2044+ * go to word previous + select
2045+ * go to word previous, simple
2046+ * go to word previous, simple + select
2047+ * go to word end
2048+ * go to word end + select
2049+
2050+"Go to word next" vs "Go to word end"?
2051+
2052+ * "...next" - jumps to the next word start (left word boundary).
2053+ * "...end" - jumps to the end of the current word (right word boundary), and after that it jumps to the next word end too.
2054+
2055+For example, Windows 7 Notepad performs "...next" on pressing Ctrl+Right, while Sublime Text 3 performs "...end" on pressing Ctrl+Right. To configure Ctrl+Right (and Shift+Ctrl+Right) behaviour, re-assign this hotkey from one command to another - to reassign it, press F9 in the Command Palette dialog.
2056+
2057+"Go to word next" vs "Go to word next, simple"?
2058+
2059+ * "..., simple" command performs simplified jump, it treats all alpha-numerical characters and symbols (#$%^&@ etc) as one group, so it makes single jump over "test@#some!" string.
2060+ * "Go to word next" treats alpha-numericals and symbols as different char groups, and stops at the beginning of each group.
2061+
2062+Plugin CudaExt provides such related commands:
2063+
2064+ * Cuda-Ext: Jump: Left into CamelCase/snake_case
2065+ * Cuda-Ext: Jump: Right into CamelCase/snake_case
2066+
2067+# Sorting and finding duplicate lines
2068+
2069+CudaText has two sorting methods.
2070+
2071+**Method 1: Plugin "Sort"**. It supports Undo for its commands. It works not fast and takes lot of memory on sorting. It cannot sort some huge files, because it reads document contents from Pascal memory buffer to Python memory buffers.
2072+
2073+Commands in the menu "Plugins / Sort" and in the Command Palette:
2074+
2075+ * Sort ascending
2076+ * Sort descending
2077+ * Sort ascending, ignore case
2078+ * Sort descending, ignore case
2079+ * Sort dialog... (shows all sorting options in dialog)
2080+ * Reverse lines
2081+ * Shuffle lines
2082+ * Remove duplicate lines
2083+ * Remove duplicate lines, but keep blanks
2084+ * Remove duplicate lines + origins
2085+ * Remove adjacent duplicate lines (ie nearest repeated lines)
2086+ * Extract duplicate lines (put duplicate lines to a new document)
2087+ * Extract duplicate lines, ignore case
2088+ * Extract unique lines
2089+ * Remove blank lines
2090+ * Remove adjacent blank lines
2091+ * Ini file: sort sections and keys
2092+ * Ini file: sort sections, but not keys
2093+ * Sort e-mail list by domain (lines should be valid email addresses to sort them by domain)
2094+
2095+The advantage of "Sort" plugin is that is has additional commands (for duplicate lines, for ini files, for e-mails).
2096+
2097+Plugin has config file, you can edit it via menu item "Options / Settings-plugins / Sort". In the section [sort] you can change option "allow_sort_all_when_none_selected" to 0 or 1 to disable/enable sorting of entire document, if nothing is selected. If selection exists (single selection), plugin handles only selected lines.
2098+
2099+**Method 2: Pascal-based sorting commands** , which are named in the Command Palette like "(without undo) sort...". They clear current Undo (ie user cannot undo sorting operation), but they are optimized for speed and memory. Commands don't read document contents into additional buffers, they sort lines in-place (changing pointers only). So these commands work with any files which CudaText can load.
2100+
2101+Commands in the Command Palette are:
2102+
2103+ * (without undo) sort ascending
2104+ * (without undo) sort ascending, ignore case
2105+ * (without undo) sort descending
2106+ * (without undo) sort descending, ignore case
2107+ * (without undo) delete all blank lines
2108+ * (without undo) delete adjacent blank lines
2109+ * (without undo) delete all duplicate lines
2110+ * (without undo) delete all duplicate lines, keep blanks
2111+ * (without undo) delete adjacent duplicate lines
2112+ * (without undo) reverse lines
2113+ * (without undo) shuffle lines
2114+
2115+These built-in commands handle only the range of selected lines, if selection exists (only first selection is handled).
2116+
2117+# Markers
2118+
2119+"Markers" are text positions which are shown with red (color in default theme) triangles below them. CudaText gives such commands in the Command Palette:
2120+
2121+ * "markers: drop marker at caret": Adds a marker on current caret position.
2122+ * "markers: go to last marker (don't delete)": Moves caret to the last placed marker without deleting it.
2123+ * "markers: collect last marker (delete)": Moves caret to the last placed marker and deletes it.
2124+ * "markers: remove all": Removes all markers in the current document.
2125+ * "markers: swap caret and last marker": Moves caret to the last placed marker, deletes this marker, and adds marker on the previous caret position. Command is to jump to the last marker, second command call jumps back, 3rd command call jumps back, etc.
2126+ * "markers: select to last marker": Makes text selection from caret position to the position of last placed marker.
2127+ * "markers: delete to last marker": Deletes text from caret position to the position of last placed marker.
2128+
2129+Markers are utilized by the Snippets plugin.
2130+
2131+[![cudatext-markers-html.png](/wiki-images/2/29/cudatext-markers-html.png)](</File:cudatext-markers-html.png>)
2132+
2133+Snippets plugin finds tab-stops in the inserting snippet text, and places markers for them. After markers are placed by Snippets plugin, Tab-key works in special way - it runs command "collect last marker", ie it jumps to the next marker ("next" by the order of tab-stop: 1, 2, 3... tab-stop 0 is the last). When user collects all markers by Tab-key, this special mode deactivates and Tab-key works as usual again. Command "markers: remove all" also deactivates that mode.
2134+
2135+Note about command "Add next occurrence of selected word". This command finds next occurrence, and adds marker (with underline) for the last added selection. This marker is special: it's intended only for this command, and it's auto-removed on a) "Cancel carets" command, b) any text changing, c) mouse click. The reason for this marker is to support "wrapped" search: command runs "wrapped" search when it reaches the document end.
2136+
2137+# Dialog "Save tabs"
2138+
2139+Dialog "Save tabs?" shows on CudaText closing, if at least one document is modified and not saved to disk. Dialog lists all modified file-tabs (usually one file per one file-tab, but it's allowed to have 2 files in a single file-tab). Checkmarks (all checked by default) are used to check/uncheck file-tabs which will be saved on pressing "Save" button. For untitled documents to be saved, program will show "Save as" prompts. Button "Don't save" closes dialog and program, losing modifications. Button "Cancel" closes the dialog, but not the program.
2140+
2141+CudaText has the option "ui_reopen_session". When it is true, dialog "Save tabs?" shows additional button: "Don't save / Keep in session", which doesn't save disk files, but stores modified documents to active "session" file. Program will read it on start.
2142+
2143+Also CudaText gives the command "dialog: save tabs" in the Command Palette. It shows the same dialog, the difference is that buttons do not close the program.
2144+
2145+# Hex display of special chars
2146+
2147+Editor shows some characters in a "hex form", like "x2000" for character U+2000. For codes below 0x100, hex form is shorter, like "x01" for character U+0001. If single-byte encoding is used (e.g. cp437), then only the short hex form is used. Hex form is rendered with different font color.
2148+
2149+[![cudatext-hex-chars.png](/wiki-images/8/80/cudatext-hex-chars.png)](</File:cudatext-hex-chars.png>)
2150+
2151+Special characters which are always rendered in the hex form (this is not configurable):
2152+
2153+ * U+0000...U+001F, except Tab-char U+0009
2154+ * U+2000...U+200F: white spaces + specials
2155+ * U+2028...U+202F: white spaces + specials
2156+ * U+2066...U+2069
2157+ * U+0085
2158+ * U+061C
2159+ * U+FEFF
2160+
2161+# Tabs features
2162+
2163+Control of UI tabs is named ATTabs, and has many features:
2164+
2165+ * Pseudo-tab "+" at the end. Option "ui_tab_show_plus".
2166+ * Scrolling arrows (on the left by default), to scroll tabs when there are lot of them and they don't fit. Thin scrolling indicator auto-appears on the top (default color is red).
2167+ * Drop-down arrow (on the right by default), to show menu of all tabs in the current group.
2168+ * Tabs can be placed on all 4 sides: top, bottom, left, right. Option "ui_tab_position".
2169+
2170+[![cudatext-tabs-left .png](/wiki-images/c/c8/cudatext-tabs-left_.png)](</File:cudatext-tabs-left_.png>)
2171+
2172+ * Layout of "arrows" is customizable. Option "ui_tab_button_layout". Button "+" is available, to replace "+" pseudo-tab, this button is always visible (pseudo-tab can be scrolled away). Button "x" is available, to close the current tab. Screenshot shows the layout with all possible buttons placed on the left.
2173+
2174+[![cudatext-tabs-layout.png](/wiki-images/f/f2/cudatext-tabs-layout.png)](</File:cudatext-tabs-layout.png>)
2175+
2176+ * Tabs can be multi-line. In multi-line mode, tabs-control changes its own height. But this height is limited by 2/3 of the window height. Option "ui_tab_multiline".
2177+
2178+[![cudatext-tabs-multiline.png](/wiki-images/4/41/cudatext-tabs-multiline.png)](</File:cudatext-tabs-multiline.png>)
2179+
2180+ * Tabs can have fixed or variable width. "Variable width" means that tabs are auto-stretched to fit the longer title. Option "ui_tab_variable_width". Minimal/maximal width of fixed tabs is customizable.
2181+
2182+ * Tabs can be shaped/bordered, or can be flat. Option "ui_tab_flat". Flat tabs are painted with additional colored underline for the active document.
2183+
2184+[![cudatext-tabs-flat.png](/wiki-images/9/92/cudatext-tabs-flat.png)](</File:cudatext-tabs-flat.png>)
2185+
2186+ * Tabs can be dragged by mouse: inside original group or to another groups (to show another groups use "Split" top menu item). And can be moved to specified group index using tab context menu items "Move tab to group n".
2187+ * Program can be used without tabs at all. Options "ui_tab_show" and "ui_tab_disabled".
2188+
2189+ * Tabs can be colored, by calling tab's context menu, and "Set tab color..." menu item. Internally, it calls plugin cuda_palette to choose the color, then color is applied. Plugin dialog has several modes (even simplest mode named "60 colors" is enough). By default, only thin line at the edge of tabs is colored, but you can colorize the entire tab using CudaText option "ui_tab_fullcolor". Coloring is saved to session (tab color is usual property of editor).
2190+
2191+[![cudatext-tab-colors.png](/wiki-images/e/ea/cudatext-tab-colors.png)](</File:cudatext-tab-colors.png>)
2192+
2193+ * Tabs can have file-type icons, if plugin "Tab Icons" is installed (icons are preinstalled already, they are used by Project Manager). Plugin also allows to assign icons from additional set of 16x16 PNG files.
2194+
2195+[![cudatext-tab-icons.png](/wiki-images/9/98/cudatext-tab-icons.png)](</File:cudatext-tab-icons.png>)
2196+
2197+ * Tabs can show "path suffix" when there are several tabs for the same base filename. In the example picture, we have opened files "t.txt" from 3 different folders, and tabs show that folders after a bullet-char. Feature can show "path suffix" for up to 4 folder levels.
2198+
2199+[![cudatext-tabs-path-suffix.png](/wiki-images/f/f1/cudatext-tabs-path-suffix.png)](</File:cudatext-tabs-path-suffix.png>)
2200+
2201+ * When too many tabs are opened, so that they don't fit by width/height:
2202+ * the left/right "arrow" icons become working, they scroll the tabs-control;
2203+ * the reddish "scroll marker" appears at the edge of the tab-control. Picture shows 2 windows with the scroll marker: one with single-line tabs, another is with multi-line tabs.
2204+
2205+[![cudatext-tabs-red-marker.png](/wiki-images/c/cc/cudatext-tabs-red-marker.png)](</File:cudatext-tabs-red-marker.png>)
2206+
2207+ * Tabs can be made "pinned" using tab's context menu item "Pinned". Pinned tab caption renders with a "!" prefix char. Commands "Close all tabs" and "Close other tabs" skip pinned tabs. Closing of a pinned tab shows additional confirmation like "Tab is pinned... Are you sure you want to close it?".
2208+
2209+# Activating internet links
2210+
2211+CudaText allows to activate internet links (URLs) and e-mails (e-mail can be with the '[mailto:'](<mailto:'>) and without it). This feature needs that links are automatically underlined in the editor. After the double-click on an underlined link, editor shows small button over the link (button with caption "Open link" or "Send e-mail"), and clicking on this temporary button activates the link.
2212+
2213+[![cudatext-click-link.png](/wiki-images/2/2e/cudatext-click-link.png)](</File:cudatext-click-link.png>)
2214+
2215+This works with the default values of 2 options:
2216+
2217+ * "links_regex": it must include RegEx, which detects and underlines links
2218+ * "mouse_click_links": it gives choices:
2219+ * don't activate links by clicks
2220+ * activate by single click
2221+ * activate by double click
2222+
2223+# HTML color codes underlining
2224+
2225+CudaText can colorize HTML color codes, which have these forms:
2226+
2227+ * #abc
2228+ * #abc0
2229+ * #aabbcc
2230+ * #aabbcc00
2231+ * rgb(100, 200, 100)
2232+ * rgba(100, 200, 100, 0.5)
2233+ * hsl(0, 100%, 50%)
2234+ * hsla(0, 100%, 50%, 0.5)
2235+
2236+Two options configure this feature:
2237+
2238+ * "underline_color_files": Specifies which file extensions are supported by the feature.
2239+ * "underline_color_size": Specifies the size of colored block in the editor area. It can be simple underline below the color code, or a background highlighting. Background highlighting can be in 2 variants: for entire text, for the fragment inside brackets.
2240+
2241+Screenshot shows all 3 variants in different CudaText windows:
2242+
2243+[![cudatext-color-underline.png](/wiki-images/1/1a/cudatext-color-underline.png)](</File:cudatext-color-underline.png>)
2244+
2245+# UI scaling
2246+
2247+UI can be scaled by these options:
2248+
2249+ * "ui_scale" (needs suffix for OS): it scales the sizes of UI controls only.
2250+ * "ui_scale_font" (needs suffix for OS): it scales fonts sizes only (both editor text font and UI font).
2251+
2252+Auto-detection of current OS scale is implemented for Windows only. And you can ignore the Windows scale auto-detection, by setting the above options.
2253+
2254+Additional options are:
2255+
2256+ * "ui_tab_scale": it scales UI-tabs font, independent from other options.
2257+ * "minimap_scale": it scales minimap only, independant from other options.
2258+ * "unprinted_symbols_scale": it scales graphics rendered for non-printable stuff: spaces, tabs, EOL text markers.
2259+
2260+If you scale UI, you may want to scale the icons as well. But icons are PNG images and cannot be resized, so the solution here is additional icon sets. In the menu "Plugins / Addons Manager / Install" you will find several categories of icon sets:
2261+
2262+ * category "sidebartheme" - configured by option "ui_sidebar_theme"
2263+ * category "toolbartheme" - configured by option "ui_toolbar_theme"
2264+ * category "codetreeicons" - configured by option "ui_tree_theme"
2265+ * category "projtoolbaricons" - configured by dialog of Project Manager
2266+ * category "filetypeicons" - configured by dialog of Project Manager
2267+
2268+# Themed top menu
2269+
2270+Top menu (together with some context menus and menu from the "hamburger" icon) can be themed. Only on Windows. This needs the option `"ui_menu_themed":true` (it's 'true' by default). When option is on, menu font/background/selection/checkmarks become colored from other CudaText UI theme colors. Also, option "ui_menu_themed_font_size" allows to change the font size.
2271+
2272+You can also set colors of menu elements directly; dialog "Options / Themes / Settings - theme - ui" provides theme items for this. For example, to set the font-color of the top menu, change the color of element "top menu, font" in the dialog.
2273+
2274+[![cudatext-menu-colorsetup.png](/wiki-images/d/dd/cudatext-menu-colorsetup.png)](</File:cudatext-menu-colorsetup.png>)
2275+
2276+By default, elements "top menu, ...." in the dialog have the "none" color (crossed rectangles), it means that actual colors are taken from other UI-theme elements:
2277+
2278+ * "top menu, font" - falls back to element "tabs, font"
2279+ * "top menu, font, hotkey" - falls back to element "top menu, font" and then to element "tabs, font, modified tab"
2280+ * "top menu, font, disabled state" - falls back to element "tabs, passive tab border"
2281+ * "top menu, BG" - falls back to element "tabs, active tab BG"
2282+ * "top menu, BG, selected" - falls back to element "tabs, mouse-over tab BG"
2283+
2284+# Margins
2285+
2286+CudaText gives 2 options to render vertical lines in specified columns:
2287+
2288+ * "margin": Integer value, column of "normal margin" vertical line. This margin is used also by the word-wrapping, then "wrap_mode" option is 2 or 3. It is also used by CudaExt plugin's action(s) ("Re-wrap lines by margin").
2289+ * "margin_string": String of space-separated numbers, it makes vertical lines appear at additional columns.
2290+
2291+The plugin "Column Marks" adds more features:
2292+
2293+ * Commands to set the "normal margin" and/or "additional margins" via prompt dialog. Plugin can save entered value to the user.json config.
2294+ * Commands to move the caret though all margin columns (normal + additional), to the left/right.
2295+
2296+# Add-ons
2297+
2298+## How to disable plugins
2299+
2300+If file "plugin_disabled" (contents is ignored) exists in the plugin's folder (near install.inf), then plugin will be ignored.
2301+
2302+## Entire plugins list
2303+
2304+See the [GitHub repository](<https://github.com/halfbrained/cudatext_plugins_list>) with the readme and links about almost all published plugins. You can make Pull-Request there, if needed.
2305+
2306+## Kinds of add-ons
2307+
2308+plugins
2309+ Extensions with Python code. They add events and/or commands. Commands can be called then via "Plugins" top menu, but only if plugin's install.inf file doesn't hide menu items in "Plugins". In any case, all commands can be called via Command Palette dialog.
2310+
2311+lexers
2312+ Syntax highlighting files. For ex, Arduino lexer adds item "Arduino" to the lexer menu. Some addons can add 2 or more lexers, for ex "HTML nnnnnn" addons often add 2 lexers: one is visible in the lexer menu, another one is hidden (it supports embedded blocks).
2313+
2314+linters
2315+ Sub-plugins for CudaLint plugin. Each supports some lexer (or several similar lexers). To use them, install CudaLint plugin, open your work file, and call CudaLint commands: it calls appropriate linter and shows colored bookmarks on error/warning lines.
2316+
2317+formatters
2318+ Sub-plugins for CudaFormatter plugin. Each supports one or several lexers and can reformat source code for these lexers. Examples: Python ReIndent, JS Sort Imports, AStyle Format.
2319+
2320+tree helpers
2321+ Plugins which show Code-Tree structure and/or folding, for some lexers. For the following lexers tree-helpers are built-in (ie written in Pascal): Ini (lite lexer "Ini files ^"), Markdown, MediaWiki, reStructuredText, WikidPad, Textile.
2322+
2323+snippets_ct
2324+ Collections of text fragments, for "Snippets" plugin (which is required to use snippets). See details in the [[CudaText plugins|CudaText_plugins#Snippets]].
2325+
2326+translations
2327+ CudaText UI translations. For ex, JP translation changes all menuitems + dialogs to JP language. Dialogs of plugins are not affected.
2328+
2329+plugintranslation
2330+ Translation of plugin strings to different languages. This includes translation of strings from Python code, and strings from "install.inf" files.
2331+
2332+themes
2333+ UI/syntax themes for the "Options / Themes / Select color theme..." dialog. "UI" themes change colors of CudaText interface. "Syntax" themes change colors of text in syntax highlighted files.
2334+
2335+Icons
2336+
2337+
2338+sidebar themes
2339+ Icon sets for the sidebar (vertical row of buttons on the left side).
2340+
2341+
2342+
2343+toolbar themes
2344+ Icon sets for the main toolbar (horizontal row of buttons on the top).
2345+
2346+
2347+
2348+toolbar x icons
2349+ Icon sets for plugin "Config Toolbar", for user-added buttons.
2350+
2351+
2352+
2353+file type icons
2354+ Icon sets for the file list of "Project Manager" plugin. Usually these are repackaged icons for VS Code editor.
2355+
2356+
2357+
2358+proj toolbar icons
2359+ Icon sets for the toolbar of "Project Manager" plugin.
2360+
2361+
2362+
2363+code-tree icons
2364+ Icon sets for the Code-Tree (icons are visible in the Code-Tree with some lexers, e.g. C#).
2365+
2366+build systems
2367+ Configuration files for different external tools, for the Runner plugin. Runner plugin supports build-systems for Sublime Text 3 (only JSON configs, without support for additional Python codes).
2368+
2369+packages
2370+ Packages with possible binary files, which will be unpacked to the CudaText installation folder. For the date 2021.08, these are only Python engines, for CudaText Windows build.
2371+
2372+## How to install add-ons offline
2373+
2374+Usually users install add-ons online, using "Plugins / Addons Manager / Install" command. But for some users online method is not available. How to install add-ons offline:
2375+
2376+ * Download all add-ons in one zip file from this SourceForge page: <https://sourceforge.net/projects/cudatext/files/addons_all/> . Unpack this zip file to some folder.
2377+ * You will find there individual add-ons, like "plugin.xxxx.zip", "lexer.yyyy.zip", "linter.zzzz.zip" etc.
2378+ * To install individual add-on, just open its zip file in CudaText "File / Open file" dialog. CudaText will handle zip archive and suggest to install add-on from it.
2379+
2380+# Color themes
2381+
2382+## Color themes introduction
2383+
2384+There are two kinds of themes:
2385+
2386+ * UI themes, file extension .cuda-theme-ui
2387+ * Syntax themes, file extension .cuda-theme-syntax
2388+
2389+2 dialogs allow to customize these 2 kinds of themes:
2390+
2391+ * "Options / Themes / Settings - theme - ui..."
2392+ * "Options / Themes / Settings - theme - syntax..."
2393+
2394+And 3rd dialog allows to switch the currently active theme:
2395+
2396+ * "Options / Themes / Select color theme..."
2397+
2398+How to use customization dialogs, steps:
2399+
2400+ * Call dialog: "Options / Themes / Settings - theme - xxxx..."
2401+ * For UI themes: customize colors in dialog
2402+ * For syntax themes: customize lexer-styles in dialog
2403+ * For syntax themes: test theme at least on JavaScript/HTML/CSS/C/Pascal/Ini/Markdown lexers. On what files to test:
2404+ * You can use sample codes in the "Options / Lexers / Lexer properties" dialog.
2405+ * You can use sample files from <https://github.com/Alexey-T/lexer_tests/tree/master/test_CudaText_color_themes>
2406+ * New theme files are saved in the subfolder "data/themes"
2407+
2408+Don't configure custom lexer styles in the "Options / Lexers / Lexer properties" dialog, if option "ui_lexer_themes" is on (usually it's on), because syntax-theme will override all your colors from that dialog. You can configure colors there, if option is off.
2409+
2410+## UI theme items with none-values
2411+
2412+The following UI theme items allow "none" values, it means that JSON theme-file stores the empty string for them, and plugin API returns COLOR_NONE value for them.
2413+
2414+ * EdCurLineBg2 / 'editor, current line BG': when "none", it falls back to EdCurLineBg
2415+ * EdBlockStapleActive / 'editor, block staples, for caret': when "none", it falls back to EdBlockStaple
2416+ * OtherTextFont / 'single-line inputs, font': when "none", it falls back to EdTextFont
2417+ * OtherTextBg / 'single-line inputs, BG': when "none", it falls back to EdTextBg
2418+ * TabFontActive / 'tabs, font, active tab': when "none", it falls back to TabFont
2419+ * TabCloseBg / 'tabs, close button BG': when "none", X-icon background is not painted
2420+ * StatusFont / 'statusbar, font': when "none", it falls back to ButtonFont
2421+ * StatusBg / 'statusbar, BG': when "none", it falls back to TabBg
2422+
2423+And the following items, which colorize the main menu - they are used only on Windows:
2424+
2425+ * MenuFont / 'top menu, font': when "none", it falls back to TabFont
2426+ * MenuFontHotkey / 'top menu, font, hotkey': when "none", it falls back to MenuFont, then to TabFontMod
2427+ * MenuFontDisabled / 'top menu, font, disabled state': when "none", it falls back to TabBorderPassive
2428+ * MenuBg / 'top menu, BG': when "none", it falls back to TabBg
2429+ * MenuSelBg / 'top menu, BG, selected': when "none", it falls back to TabOver
2430+
2431+## How to create theme package
2432+
2433+ * If your theme files need some sort of 'suffix' (e.g. "dark", "light", "alternative"), put these suffixes into round brackets, after space-char, in the filename. For example, name the file "brackets (dark).cuda-theme-ui" instead of "brackets-dark.cuda-theme-ui". This is required by Addons Manager plugin, which will need to find the add-on package for your theme.
2434+
2435+ * Create such file "install.inf" in UTF-8 encoding (without BOM):
2436+
2437+```
2438+[info]
2439+ title=MyName UI theme (by AuthorName)
2440+ type=cudatext-data
2441+ subdir=themes
2442+ homepage=https://github.com/nnnn/pppp
2443+```
2444+
2445+ * Make zip file "theme.MyName.zip" with files "MyTheme.cuda-theme-nnnnn" and "install.inf".
2446+ * Test zip file: open zip file in CudaText, confirm installation.
2447+ * Publish file at forum or <https://github.com/Alexey-T/CudaText/issues>
2448+
2449+## Meaning of UI-theme elements
2450+
2451+ * "editor, font" - Color of editor font, when no lexer is active. To deactivate lexer in current editor ui-tab: click statusbar cell with lexer name, call item "(none)" in the menu.
2452+
2453+ * "editor, disabled state, font/BG" - Editor is shown as disabled when Replace dialog runs 'Replace all' action, with option "Confirm on replace" (when the confirmation message is shown, editor is disabled). Too see the "..., font" color applied, deactivate the editor lexer.
2454+
2455+ * "editor, current line BG, other wrapped parts" - Color is used for long wrapped lines, when options `"show_cur_line":true` and `"show_cur_line_minimal":false`. Color is used for background of non-current wrapped line parts, belonging to the caret's line. By default color is 'none', so program falls back to "current line BG" for other wrapped parts.
2456+
2457+ * "editor, horizontal folding line" - This line is painted below the folded block, when option `"fold_style":4`, and you fold (collapse) some folding-range (with some lexer active).
2458+
2459+ * "editor, marked range BG" - Color is shown for marked range. To set marked range e.g. from line 5 to 10, enter in the Console:
2460+```
2461+ed.set_prop(PROP_MARKED_RANGE, '5,10')
2462+```
2463+
2464+.
2465+
2466+ * "editor, markers" - Color of "markers" feature. To see markers, call Command Palette's command "drop marker at caret".
2467+
2468+ * "editor, minimap, tooltip border" - Border rectangle, painted over a) tooltip which is shown for mouse-over-folded-block with option `"fold_tooltip_show":true`, b) tooltip which is shown for mouse-over-minimap with option `"minimap_tooltip_show":true`.
2469+
2470+ * "editor, wrapped line indent vert-lines" - Vertical line is painted on the left side of the wrapped part, if you have long wrapped line, and this line begins with e.g. 10 spaces.
2471+
2472+ * "statusbar alt" - Color is used on alternative statusbar. Too see this statusbar, enter in the Console input field:
2473+```
2474+msg_status_alt('d'*100, 8)
2475+```
2476+
2477+.
2478+
2479+ * "search progressbar" - To see it, call Replace dialog, with RegEx option on, with Confirmation option on (2 options in the Replace dialog), and do the mass replacement of RegEx "." with "www".
2480+
2481+ * "side-toolbar, button badges font/BG" - Color of text badges. To see a badge on sidebar, write to Console input field:
2482+```
2483+print("ERROR: aaa")
2484+```
2485+
2486+. The line "ERROR: aaa" will appear in the Console log, and sidebar will show badge "1", meaning you have 1 error line.
2487+
2488+ * "listbox, ..." - Colors of Command Palette dialog, Go To dialog, and similar menu-like dialogs.
2489+
2490+ * "listbox, ..., auto-complete..." - Colors of auto-completion listbox. To see the auto-completion listbox, activate e.g. Pascal lexer, write the incomplete word "Wr" and press Ctrl+Space to call auto-completion. Listbox has 3 columns, 3rd column is shown not for all items.
2491+
2492+ * "splitters, main" - Color is shown on (vertical) splitter near sidebar and above (horizontal) splitter near bottom panel.
2493+
2494+ * "splitters, groups" - Color is shown on splitters between groups (vertical and horizontal). To see these splitters, activate e.g. 2 or 3 groups using "Split" top menu item.
2495+
2496+## Meaning of syntax-theme elements
2497+
2498+ * Id: Normal id (identifier) or text.
2499+ * Id1: Used for various id kinds, e.g. when id has mixed-casing like "SomeClassName".
2500+ * Id2: Used for standard type names like "int"/"bool"/"float" and sometimes for constants like "true"/"false"/"null".
2501+ * Id3: Used for CSS measurement units like "px" and class/function modifiers like "public"/"private".
2502+ * Id4: Used not often, for some special kinds of identifiers.
2503+ * IdKeyword: Used for syntax keywords like "for"/"if"/"class".
2504+ * IdVar: Variables, e.g. "$name" in PHP and Bash.
2505+ * IdBad: Incorrect/misslepped id.
2506+ * String: String literals.
2507+ * String2: String literals, used e.g. for RegEx constants.
2508+ * String3: String literals, one more kind, rarely used.
2509+ * Symbol: Non-word symbols, ie brackets/punctuation/operators.
2510+ * Symbol2: Non-word symbols, used when syntax needs another style for e.g. assignment/math operators.
2511+ * SymbolBad: Incorrect non-word symbols.
2512+ * Comment: Comments.
2513+ * Comment2: Comments, used when syntax needs another style of comments, e.g. shebang in Bash.
2514+ * CommentDoc: Documentation comments, ie comments which are parsed by special tools.
2515+ * Number: Numbers: decimal, hex, octal, binary, floating point.
2516+ * Label: Used e.g. in Python for function/class names after "def"/"class". Used for "GoTo labels" if a language supports such a thing.
2517+ * Color: Color constants, like #RRGGBB in HTML/CSS.
2518+ * IncludeBG#, SectionBG#: Styles which have background color set, and foreground color unset (none). Used to highlight function blocks, sub-lexer blocks, parts of a file, etc.
2519+ * BracketBG: Style with background+foreground colors. Used to highlight paired brackets, begin/end keywords, repeat/until keywords (when "dynamic highlighting" option is on) etc.
2520+ * CurBlockBG: Style with background color set, foreground color unset. Used to highlight block under caret, when "dynamic highlighting" option is on.
2521+ * SeparLine: Frame color for Find/Replace dialog's "Highlight all" ("Hi") results.
2522+ * TagBound: HTML tags: angled brackets.
2523+ * TagId: HTML tags: tag names.
2524+ * TagIdBad: HTML tags: incorrect tag names.
2525+ * TagProp: HTML tags: properties/attributes of tags, before "=" char.
2526+ * TagPropBad: HTML tags: incorrect props/attributes of tags.
2527+ * TagInclude: Tags used for inclusion of sub-lexer blocks. Used e.g. in PHP, <? ?>.
2528+ * LightBG#: Styles with bright background color, and normal foreground. Used e.g. in Diff to highlight deleted (LightBG1) / changed (LightBG2) / added (LightBG3) text blocks. Also used by Git_Status plugin to mark "Git changed" lines on the editor gutter.
2529+
2530+# Tech topics
2531+
2532+## Encoding detection
2533+
2534+Encoding detection works by this pseudo-code:
2535+```
2536+// Corresponding source code is in repository ATSynEdit, file atstrings_load.inc,
2537+ // procedure DoDetectStreamEncoding and
2538+ // procedure TATStrings.DoLoadFromStream
2539+
2540+ if file_has_signature(UTF8) then
2541+ return(UTF8)
2542+
2543+ if file_has_signature(UTF32_LE) then
2544+ return(UTF32_LE)
2545+
2546+ if file_has_signature(UTF32_BE) then
2547+ return(UTF32_BE)
2548+
2549+ if file_has_signature(UTF16_LE) then
2550+ return(UTF16_LE)
2551+
2552+ if file_has_signature(UTF16_BE) then
2553+ return(UTF16_BE)
2554+
2555+ if file_size > 50M then
2556+ return(UTF8)
2557+
2558+ if encoding_saved_to_history_file(enc) then
2559+ // function changes the "enc" param
2560+ return(enc)
2561+
2562+ enc = UTF8
2563+
2564+ detect = file_detect_utf8_content
2565+ // it can get 3 values:
2566+ // UTF8_ASCII: only ASCII chars present
2567+ // UTF8_OK: correct UTF8, non-ASCII, chars present
2568+ // UTF8_BROKEN: broken UTF8 chars present
2569+ if detect == UTF8_OK then
2570+ return(UTF8)
2571+ if detect == UTF8_BROKEN then
2572+ enc = fallback_encoding // from option "fallback_encoding"
2573+
2574+ if file_detect_by_python_standard(detect) then
2575+ // it returns detected encoding in "detect" param
2576+ return(detect)
2577+
2578+ if file_detect_by_xml_signature(detect) then
2579+ // it returns detected encoding in "detect" param
2580+ return(detect)
2581+
2582+ if file_detect_utf16_content(detect) then
2583+ // it returns detected encoding in "detect" param
2584+ return(detect)
2585+
2586+ return(enc)
2587+```
2588+
2589+UTF-8 content detection works by first 8K of file. UTF-16 content detection works by first 5K of file. If encoding was detected as UTF8, the file loader checks the content again (the entire file size now) for UTF8 chars correctness, and if it finds "not correct UTF8 chars", encoding will be changed to ANSI.
2590+
2591+ANSI maps to one of real codepages, it depends on current Windows locale. On non-Windows OS, ANSI maps to cp1252.
2592+
2593+What is "file_detect_by_python_standard"? It is detection [by this standard](<https://docs.python.org/3/reference/lexical_analysis.html#encoding-declarations>). Encoding name is searched by RegEx in the first 1-2 lines of file, if they are comment lines. Comments of these kinds are supported: // # ; --. For simplicity, comment chars are skipped, ignoring current lexer, so it works for all files and all lexers.
2594+
2595+What is "file_detect_by_xml_signature"? It is detection by signature, in the first file line, like this:
2596+```
2597+<?xml version="1.0" encoding="ISO-8859-9"?>
2598+```
2599+
2600+## Reduced functionality for big files
2601+
2602+CudaText has the following optimizations for big files and huge lines:
2603+
2604+ * CudaText refuses to load files >500Mb. See the option `"ui_max_size_open":500` (in Mbytes). Program allows to open such files in built-in viewer (without editing).
2605+
2606+ * Word-wrap mode is automatically turned off, when total lines count in document is huge. See the option `"wrap_enabled_max_lines":60000`. When word-wrap mode is off, editor's work is much faster.
2607+
2608+ * Program refuses to activate "normal" lexer for big files >2Mb. See the option `"ui_max_size_lexer":2` (in Mbytes). Note that "lite" lexers with suffix "^" are still enabled for big files.
2609+
2610+ * If file is loaded in "normal" lexer, but count of lines is big, program disables finding of fold-ranges. Syntax coloring works, but folding doesn't work. See the option `"lexer_folding_max_lines"`.
2611+
2612+ * If file is loaded in "normal" lexer, dynamic highlightings are disabled in big files. See the option `"dynamic_highlight"`.
2613+
2614+ * For any files, when too many multi-carets are placed, program disables/clears the Undo-information for editing. See the option `"undo_max_carets"`.
2615+
2616+## CJK text is rendered bad on huge lines
2617+
2618+[![cudatext-cjk-len1024.png](/wiki-images/a/ab/cudatext-cjk-len1024.png)](</File:cudatext-cjk-len1024.png>)
2619+
2620+On lines longer than 4K chars, CJK text is rendered not nicely - full-width chars are rendered as half-width chars, so they overlap. This is internal limitation of CudaText. There is no option for this. This is limitation for non-wrapped lines. When you turn word-wrap on, all wrapped parts will be rendered correctly.
2621+
2622+Maximal length of this limit can be changed in the source code. Find this line in the file "atsynedit/atsynedit/atstringproc.pas":
2623+```
2624+ATEditorMaxFixedArray = 4*1024;
2625+```
2626+
2627+## How to open files in a new window instead of a new tab
2628+
2629+Option "ui_one_instance" controls it, so change it to 'false' (without quotes, in "user.json"). This option is here for several years already, but people are asking this question again and again (forum, GitHub, Linux sites). Seems the term "instance" is not known very good, people cannot find this option easily.
2630+
2631+## How to compile CudaText
2632+
2633+First, install FPC and Lazarus:
2634+
2635+ * [download FpcUpDeluxe](<https://github.com/newpascal/fpcupdeluxe/releases>). On Windows, you must unlock .exe file in the Windows Explorer dialog.
2636+ * in FpcUpDeluxe, choose FPC last release, install it first.
2637+ * in FpcUpDeluxe, choose Lazarus (last release or Git 'main'), install it next.
2638+
2639+**Classic way to compile**
2640+
2641+ * download GitHub repos:
2642+ * <https://github.com/bgrabitmap/bgrabitmap> (install first)
2643+ * <https://github.com/Alexey-T/Python-for-Lazarus>
2644+ * <https://github.com/Alexey-T/ATFlatControls>
2645+ * <https://github.com/Alexey-T/EncConv>
2646+ * <https://github.com/Alexey-T/ATSynEdit> (install after ATFlatControls and EncConv)
2647+ * <https://github.com/Alexey-T/EControl> (install after ATSynEdit)
2648+ * <https://github.com/Alexey-T/ATSynEdit_Ex> (install after EControl)
2649+ * <https://github.com/Alexey-T/ATSynEdit_Cmp>
2650+ * <https://github.com/Alexey-T/ATBinHex-Lazarus>
2651+ * <https://github.com/Alexey-T/Emmet-Pascal>
2652+ * <https://github.com/Alexey-T/CudaText> (no package here, only project)
2653+
2654+ * install .lpk packages into Lazarus (find all .lpk files, open them in IDE, install from Packages dialog)
2655+ * in the Lazarus component palette, you should see:
2656+ * "AT Controls" tab: TATButton, TATButtonsToolbar, TATListbox, TATScroll, TATSynEdit, TATLabelLink, TATGauge
2657+ * "Python" tab: several items
2658+ * in Lazarus, open "cudatext.lpi" project, compile it
2659+
2660+**CudaText_up way to compile**
2661+
2662+There is [Linux script CudaText_up](<https://github.com/Alexey-T/CudaText_up>) \- it downloads sources to ~/cudatext_up, then calls Lazarus to compile them. You can use it with FPC cross-compilers, installed from FpcUpDeluxe, script will compile CudaText for any of available platforms. Without cross-compilers, script makes CudaText only for the current platform. It puts result to ~/cudatext_up/bin.
2663+
2664+### Linux error on ATSynEdit compiling
2665+
2666+You may get this error:
2667+```
2668+atsynedit_adapter_gtk2ime.pas(131,5) Error: (5000) Identifier not found "IM_Context_Set_Cursor_Pos"
2669+```
2670+
2671+To avoid this error, open IDE dialog "Tools / Configure 'Build Lazarus'", and there enable the define:
2672+```
2673+WITH_GTK2_IM
2674+```
2675+
2676+To enable the define, press the "Edit Defines" button in the dialog, small memo-dialog will open. Write there "WITH_GTK2_IM", press OK, word will appear in the "Configure 'Build Lazarus'" dialog. Place the checkmark near this word. After enabling the define, recompile the IDE: "Tools / Build Lazarus with profile".
2677+
2678+[![Enable these IDE defines](/wiki-images/8/8e/atsynedit_ide_defines.png)](</File:atsynedit_ide_defines.png> "Enable these IDE defines")
2679+
2680+### CudaText_up on Windows
2681+
2682+Few tricks are required to build CudaText via CudaText_up. Retrieve <https://github.com/Alexey-T/CudaText_up> using "git clone". Use Git Bash to run the cudaup.sh:
2683+```
2684+cd /C/Prj/Pas/CudaText_up
2685+ ./cudaup.sh
2686+```
2687+
2688+The command "./cudaup.sh --get" did not succeed from the first attempt, because Git under Windows downloads text files with CRLF line endings, whereas the cudaup.sh expects the files "cudaup.packets" and "cudaup.repos" to have LF line endings. So open these two files in text editor and change the line endings to LF. After that, "./cudaup.sh --get" succeded. Then run
2689+```
2690+./cudaup.sh --lazdir /C/fpcupdeluxe/lazarus --packs
2691+```
2692+
2693+specifying the path where FpcUpDeluxe was previously installed. Finally run
2694+```
2695+./cudaup.sh --lazdir /C/fpcupdeluxe/lazarus --make --os win64
2696+```
2697+
2698+where the part "--os win64" was absolutely essential because without it the project tried to be compiled under Linux (that obviously failed on a Windows machine).
2699+
2700+## How to install plugins from GitHub
2701+
2702+First, you need to know GitHub repository (repo) URL of plugin. For example, <https://github.com/kvichans/cuda_find_in_files> . If you have plugin already, then you can see this URL in the plugin's install.inf (line "homepage=").
2703+
2704+Next, call CudaText menu item "Plugins / Addons Manager / Install from GitHub". Enter URL in the suggested dialog. Addons Manager will install latest version from GitHub. Addons Manager supports all branch names ("master", "main" and others), it will show menu of branch names if there are several branches in the repo. The repo must have correct file "install.inf" in the root, otherwise Addons Manager may not detect the plugin in the repo.
2705+
2706+After you entered the URL, Addons Manager shows messagebox:
2707+```
2708+GitHub repository can be cloned (using "git clone") or can be downloaded as zip file. If you clone, Addon Manager's Update dialog will update add-on using "git pull", which is recommended.
2709+ Buttons: Cancel / Download as zip / Clone repo.
2710+```
2711+
2712+Better to choose "Clone repo" here, this will allow to update plugin directly from GitHub. Choosing the "Download as zip" is ok, but you cannot update plugin from GitHub, you can update plugin only from the released versions from SF.net.
2713+
2714+## How to simply install many add-ons
2715+
2716+ * In the dialog "File / Open file", you can multi-select files in list - with Ctrl+click (on Windows) or Shift+arrows.
2717+ * Use command "Plugins / Addons Manager / Download all", which saves all addons zip files to some folder. When done, install many addons from this folder using "File / Open file" multi-selection.
2718+ * There is [this page](<https://sourceforge.net/projects/cudatext/files/addons_all/>) with zipped collection of all addons, but it is updated not often.
2719+
2720+## How to make translation
2721+
2722+Translation template file is in the folder "data/lang". The template file cannot be activated from "Options / Translations". How to prepare the translation zip package:
2723+
2724+ * make the file "nn_NN.ini" (UTF-8 with BOM)
2725+ * use standard locale names in filename, e.g. ru_RU pt_PT ja_JP (this is needed for plugins which use Python translation API)
2726+ * write your contacts in the first commented lines. Comments must begin with ";" at line start. Also you can add other comments.
2727+ * to set accelerator-chars for menus/dialogs, use "&" char (e.g. "Open &file"). If needed "&" char as is, duplicate it as "&&".
2728+ * note: Linux Ubuntu font is about 1.3 times wider, than on Windows
2729+
2730+ * make the file "install.inf" with such text:
2731+
2732+```
2733+[info]
2734+ title=LangName translation (by AuthorName)
2735+ type=cudatext-data
2736+ subdir=lang
2737+```
2738+
2739+ * make the zip file "translation.nn_NN.zip", it must contain files nn_NN.ini, install.inf
2740+ * test this zip file: open it in CudaText via "File / Open", and check it's installed
2741+ * publish this zip file, at CudaText forum or at GitHub issues <https://github.com/Alexey-T/CudaText/issues>
2742+ * if package is OK, it will be at SourceForge downloads, and in Addon Manager
2743+
2744+## How to make translation of Plugins menu
2745+
2746+CudaText supports translation of Plugins menu items. For example, you have plugin with module cuda_nnn, which has "install.inf" with such menu items:
2747+```
2748+[item1]
2749+ ...
2750+ caption=MyPlugin\ItemOne
2751+ ...
2752+ [item2]
2753+ ...
2754+ caption=MyPlugin\SubMenu\ItemTwo
2755+ ...
2756+```
2757+
2758+Then you need to create files like "ru_RU.ini" in the folder "data/langmenu/cuda_nnn". Create folder "langmenu" inside "data" if it's absent. Files must be in UTF-8 no BOM encoding. They must have section "menu". All items in the ini-file are optional.
2759+```
2760+[menu]
2761+ MyPlugin=local name
2762+ ItemOne=local name of item
2763+ ItemTwo=local name of item
2764+ SubMenu=local name of menu
2765+```
2766+
2767+To distribute those translation(s), make zip file like "langmenu.MyPlugin.zip", which must have "install.inf" and folder "cuda_nnn" (you can put more folders, for several plugins, if you want so). "install.inf" contents:
2768+```
2769+[info]
2770+ title=Translation of menu items of MyPlugin
2771+ type=cudatext-data
2772+ subdir=langmenu
2773+```
2774+
2775+Look at example ZIP packages [at SourceForge page](<https://sourceforge.net/projects/cudatext/files/addons/plugintranslation/>).
2776+
2777+## How to copy word under caret to clipboard
2778+
2779+A1: Install "Macros" plugin. In its dialog start recording a macro, and call these commands using "Command Palette":
2780+
2781+ * command "selection: select words at carets"
2782+ * command "clipboard: copy"
2783+ * command "selection: cancel selection"
2784+
2785+Then assign a hotkey to this macro (in the "Command Palette", find your new macro and press F9).
2786+
2787+A2: Plugin "CudaExt" has commands:
2788+
2789+ * plugin: CudaExt: Copy word or [expression] or 'expression' without selection
2790+ * plugin: CudaExt: Replace word or [expression] or 'expression' with clip
2791+
2792+It's good to use these commands with hotkeys Alt+Left and Alt+Right (assign it in the "Command Palette").
2793+
2794+## Linux: In Qt5 version, text is shifting on selection
2795+
2796+Q1: After some typing, the caret get unaligned with the text. It sort of creeps into the text, making it both tricky to read and tricky to edit.
2797+
2798+Q2: When I select text that is inside a string literal (for example), the beginning of the selection gets a space before it, shifting the selected text to the right. As I select more the text continues to squish around.
2799+
2800+A: That's the issue specific to (Linux) Qt5 version. It's fixable by the option "renderer_tweaks__linux", its default value is:
2801+```
2802+"renderer_tweaks__linux": "ws",
2803+```
2804+
2805+Description of this option in the default config:
2806+```
2807+//Value is a string of several chars:
2808+ // if 'w' in value: Use simplified calculation of average character width.
2809+ // On Windows, 'w' is good.
2810+ // On macOS, 'w' is bad.
2811+ // On GTK2, 'w' is not needed.
2812+ // On Qt5, 'w' gives various results, it depends on Desktop Environment.
2813+ // if 'o' in value: Calculate 'offsets' for individual characters, ie use slower API to render.
2814+ // On Windows, 'offsets' don't decrease rendering speed.
2815+ // On macOS, 'offsets' decrease (2x) rendering speed.
2816+ // On GTK2 and Qt5, 'offsets' decrease rendering speed.
2817+```
2818+
2819+Try this:
2820+
2821+ * Remove "w" char from this option, ie
2822+
2823+```
2824+"renderer_tweaks__linux" : "s",
2825+```
2826+
2827+ * Add "o" char to this option, ie
2828+
2829+```
2830+"renderer_tweaks__linux" : "wso",
2831+```
2832+
2833+Do it in the user.json config, of course. Then restart the editor.
2834+
2835+On macOS, changing the option "renderer_tweaks__mac" is usually not needed - default value works good. But in Qt5 version, CudaText cannot detect Desktop Environment settings, so default value is wrong sometimes.
2836+
2837+## Linux: How to reinstall missed files
2838+
2839+Sometimes it's needed to reinstall missed files, e.g. when you have deleted some lexers from "Lexer library" dialog. Simple re-run of .deb installer works, but it will not reinstall deleted data-files. Why? App has copy of its data-files in ~/.config/cudatext (see the topic about location of data+settings dirs). Binary (not deb installer!) makes this copy - only when binary version is not equal to the version stored to settings/packages.ini, "app" section. After you delete that "app" section, and run the binary (not deb installer), binary will refresh files from /usr/share/... to ~/.config/cudatext/...
2840+
2841+## Linux: Difference between gtk2/qt5 versions
2842+
2843+Versions for gtk2/qt5/etc are compiled for different widget-sets, all functions are the same.
2844+
2845+ * Different widget-sets make different look of native UI controls (e.g. buttons - but only native buttons, note that Find/Replace dialog has not native buttons), native scrollbars, native File-Open/Save dialogs.
2846+ * Different widget-sets need different value of "ui_buffered*" option. So one value of "ui_buffered__linux" is OK for gtk2, while may be worse for qt5.
2847+
2848+So far, different widget-sets are supported for Linux only.
2849+
2850+## Linux: Keyboard input problems
2851+
2852+1) Keyboard input is duplicated.
2853+
2854+This is known problem, related to some Input Methods (IM) in Linux. To see what is your active IM, open Terminal and enter:
2855+```
2856+echo $GTK_IM_MODULE
2857+```
2858+
2859+Known IMs with problems: scim, xim. To fix: change IM from e.g. "XIM" to "none" in the Language Support settings, then chars should not duplicate.
2860+
2861+2) Keyboard input misses accent chars.
2862+
2863+On some systems, national keyboards (e.g. French) may miss entering of accent chars. This can be solved by changing the Input Method (IM) in the system. [See here](<https://forum.endeavouros.com/t/ibus-and-qt-applications/15125>) for example.
2864+
2865+In short:
2866+
2867+ * Install "ibus" package
2868+ * In the OS environment file, set 2 variables (for 2 builds of CudaText, gtk2 and qt5):
2869+ * GTK_IM_MODULE=ibus
2870+ * QT_IM_MODULE=ibus
2871+
2872+## Unix: Program takes 25 seconds to start
2873+
2874+Q1: CudaText takes exactly 25 seconds to start-up. (In fact a few ms more than that). I am sure the problem is at my end, but cannot place it. It is waiting for something and is timing out.
2875+
2876+Q2: On Debian 12 with Mate desktop I got an empty window and it would have content only after I moved the mouse: even if I waited more then 3 minutes without moving the mouse or pressing a key, the content would appear just after moving the mouse.
2877+
2878+A: Setting the following environment variable solves the issue:
2879+```
2880+IBUS_USE_PORTAL="1"
2881+```
2882+
2883+## Unix: Program takes 60 seconds to start
2884+
2885+Q: When I open any Lazarus/GTK2 application, I get a blank window that will timeout after 60 sec and the application will appear then. If I kill this blank window, the application lauches directly and the CRITICAL output resulting from my kill is always the same:
2886+```
2887+(app_name:1299276): Gtk-CRITICAL **: 19:03:24.607: IA__gtk_widget_hide: assertion 'GTK_IS_WIDGET (widget)' failed
2888+ (app_name:1299276): Gtk-CRITICAL **: 19:03:24.607: IA__gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
2889+```
2890+
2891+If I wait for the timeout there is no output and everything works fine. This issue appeared to me when I tried to use CudaText.
2892+
2893+A: Start the application with "-disableaccurateframe" parameter.
2894+
2895+## Linux: Installation
2896+
2897+**.deb package.** To support .deb package installation, program performs copying of its files, from .deb installation folder to the settings folder. Ie, when binary "cudatext" (it can be in any folder, e.g. in /usr/bin) starts, it checks, if "data/lexlib" exists near the binary, and if not, it copies folders "py", "data", "settings_default" from .deb installation folder to "~/.config/cudatext" (default location of settings, it can be changed by command line option). Program does this not always, it reads the "settings/packages.ini", and checks there [app] "ver" value. If value not equals to the binary's hardcoded version, program does that copying. So copying occurs once, after .deb package was upgraded.
2898+
2899+**.xz package.** It is intended that user just unpacks this archive, to subdirectory of home-directory, and then runs binary "cudatext" from there. This is simpler way. But additional way is also possible - you can "install" the program, so that "cudatext" will be runnable from Terminal. The "installation" is:
2900+
2901+ * unpack CudaText .xz archive to some temp folder
2902+ * copy file "cudatext" to /usr/bin
2903+ * copy folders "py", "data", "settings_default" to "~/.config/cudatext"
2904+ * delete mentioned temp folder
2905+
2906+When you run "cudatext" (from /usr/bin), settings folder "~/.config/cudatext/settings" will be created automatically.
2907+
2908+Note, that you must download proper package for the proper architecture (x64, ARM, AArch64) and proper OS. Sometimes users download Solaris package on Linux, so "cudatext" file cannot be run.
2909+
2910+## Linux: Arch Linux packages
2911+
2912+The GTK2 and Qt5 binaries can also be installed via the AUR if you are on an Arch Linux based system:
2913+
2914+ * <https://aur.archlinux.org/packages/cudatext-gtk2-bin/>
2915+ * <https://aur.archlinux.org/packages/cudatext-qt5-bin/>
2916+
2917+## Linux: Qt5 and Qt6 builds
2918+
2919+**Qt5**
2920+
2921+For Linux Qt5 version, library libQt5Pas is required, release 1.2.15 or newer. Get it from [releases on this page](<https://github.com/davidbannon/libqt5pas/releases>).
2922+
2923+Page contains 2 packages: libqt5pas and libqt5pas-dev, you only need first of them (2nd one is required if you want to compile the app).
2924+
2925+In the GutHub page, press the link like "Show all 22 asserts" and there you will see files:
2926+
2927+ * libqt5pas1_2.15-1_amd64.deb - deb package.
2928+ * libqt5pas_1_2_15-1_amd64.tar.gz - compressed .so files. You can put .so files near the binary "cudatext" and run the editor with such command:
2929+
2930+```
2931+LD_LIBRARY_PATH=. ./cudatext
2932+```
2933+
2934+Some package managers have Qt5Pas package. On Ubuntu: "libqt5pas-dev", on Manjaro: "qt5pas". At the end of 2023 year, these packages are outdated. CudaText crashes with them on closing file-save dialog, with error in Terminal:
2935+```
2936+symbol lookup error: /home/user/cudatext/cudatext: undefined symbol: QTimer_singleShot3
2937+```
2938+
2939+**Qt6**
2940+
2941+For Linux Qt6 version, library libQt6Pas is required, release 6.2.2 or newer. Get it from [releases on this page](<https://github.com/davidbannon/libqt6pas/releases>).
2942+
2943+Page contains 2 packages: libqt6pas6 and libqt6pas6-dev, you only need first of them (2nd one is required if you want to compile the app).
2944+
2945+## Linux: Fedora packages
2946+
2947+To install CudaText on Fedora Linux, make sure you have the DNF core plugins installed on your system. Then, run this command:
2948+```
2949+dnf copr enable -y zliced13/YACR
2950+```
2951+
2952+Afterwards, you can finally install CudaText with this command:
2953+```
2954+dnf install -y cudatext
2955+```
2956+
2957+In this command, replace package name "cudatext" with one of available names:
2958+
2959+ * cudatext-gtk2
2960+ * cudatext-gtk2-aarch64
2961+ * cudatext-qt5
2962+ * cudatext-qt5-aarch64
2963+ * cudatext-qt6
2964+ * cudatext (copy of cudatext-qt6)
2965+ * cudatext-aarch64 (copy of cudatext-qt5-aarch64)
2966+
2967+The *.spec files for all of these packages: <https://github.com/kris3713/YACR/tree/master/packages/cudatext>
2968+
2969+## Linux: App cannot run with GLIBC error
2970+
2971+Some Linux distros may show such error:
2972+```
2973+./cudatext: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./cudatext)
2974+```
2975+
2976+This is reported for CudaText builds made by author on 2nd PC with newer GLIBC version. If app was compiled with newer GLIBC, OS with older GLIBC cannot run the app.
2977+
2978+To 'fix' this, install FreePascal/Lazarus and compile CudaText from sources on your PC. Better use fpcUpDeluxe tool, which allows 2-clicks installation of FreePascal with Lazarus.
2979+
2980+## FreeBSD: App cannot run
2981+
2982+If you run app in Terminal, you'll see an error about missing .so file. Reason of this error: FreeBSD version was compiled on Linux with different .so files. To fix error, run command in Terminal:
2983+```
2984+$ sudo ln -s /usr/local/lib/libiconv.so.2 /usr/local/lib/libiconv.so.3
2985+```
2986+
2987+## macOS: App cannot run
2988+
2989+There is known issue, when macOS AArch64 version (ie ARM 64-bit version) cannot be run. The following command clears the extended attributes from the bundle, and it can be run:
2990+```
2991+xattr -cr /Applications/CudaText.app/
2992+```
2993+
2994+(Adjust the file path, if you put the application bundle to a different place.)
2995+
2996+Also note, that our application bundle is not digitally signed. So to run it (the first time you do it), you should right-click the application bundle, and choose "Open" menu item, and confirm that you trust the vendor.
2997+
2998+## Can app save files to system directories
2999+
3000+Under Windows OS, app runs XCOPY command to save files to write-protected folders. XCOPY runs with elevated priviledges. Note: to save for example 'hosts' file on Windows 64-bit, you must use 64-bit version of CudaText.
3001+
3002+Under Linux OS (but not under *BSD/Solaris), CudaText can save files even to system write-protected folders. It runs "pkexec" program for this purpose, and "pkexec" shows GUI confirmation to get admin rights. "pkexec" runs "/bin/cp" to copy file from temp folder to the write-protected folder.
3003+
3004+For example, open some file from write-protected folder on Linux. CudaText detects file permissions, so it should open file in read-only mode. Then, from "Command Palette", call "toggle read-only mode". Then you can edit the file. Edit it and save it - CudaText will try to save it via "pkexec".
3005+
3006+## How to select extra symbols by double-click
3007+
3008+Some languages consider special symbols as word-chars. For example, in PHP, "$" symbol is part of a variable name, so double-click should select "$" together with other word-chars. Follow these steps to add extra symbols (e.g. "$") to word-chars.
3009+
3010+ * Open new file-tab, activate your lexer (click the lexer cell in the statusbar).
3011+ * Call menu item "Plugins / Options Editor Lite".
3012+ * In the "Options Editor Lite" dialog:
3013+ * Focus listbox item of the option "nonword_chars", read description about this option in the bottom.
3014+ * Click the combobox field near "Scope", and choose dropdown item "Lexer: LexerName". It is needed for option to go to the lexer-specific config.
3015+ * Edit the value of the option "nonword_chars".
3016+ * Press Enter-key in the input field, to apply the option (lexer-specific option).
3017+ * Close "Options Editor Lite" by "OK" button.
3018+
3019+What does this procedure do? It creates/modifies file "settings/lexer LexerName.json" to be like this:
3020+```
3021+{
3022+ "nonword_chars": "-+*=/\\()[]{}<>\"'.,:;~?!@#%^&|`"
3023+ }
3024+```
3025+
3026+## How to upgrade but keep all the settings
3027+
3028+ * Q: CudaText for Windows. How can I upgrade but keep all the settings the way I have configured them - including themes, icon sets, etc (basic settings I could just copy the settings file over - but I'm not sure what to do for the icons and the rest...)
3029+
3030+ * A: Copy all files from the zip package, overwriting old files. All user settings are located in "settings" (which is absent in the zip package) and "data" (in different files). If you did not modify CudaText preinstalled files, you will not loose any settings.
3031+
3032+## How to customize top menu and context menu
3033+
3034+See the page [[CudaText plugins|CudaText_plugins#Configure_Menu]].
3035+
3036+## How to help the author to reproduce a bug
3037+
3038+Bugs are often cannot be reproduced on author's PC because of different "user config", "lexer-specific configs", plugins configs. To help the author, make the ZIP file with CudaText folder, add your test file(s) there too, and send this ZIP to e-mail support(@)uvviewsoft.com .
3039+
3040+What CudaText folder to pack?
3041+
3042+ * On Windows: the folder where you copied the program. Exclude files EXE DLL PYD ZIP from ZIP.
3043+ * On macOS: ~/Library/Application Support/CudaText.
3044+ * On Linux, other Unixes: ~/.config/cudatext, or $XDG_CONFIG_HOME/cudatext if this OS variable is set.
3045+
3046+Make the bug reproducible on your CudaText folder on your test file(s). Put your test file(s) in ZIP too. If needed to reproduce the bug, create the session using Session Manager plugin (bug may be visible only with some session). Put session file in ZIP too (usually it's already in the "settings" subfolder).
3047+
3048+## Behaviour of column selection
3049+
3050+CudaText gives two modes of column selection, which have differences when you select over wrapped lines, or lines with full-width characters. This is controlled by the option "carets_primitive_column_sel".
3051+
3052+ * Value "true": "pritimive mode" which behaves much like Sublime Text. In this mode editor places multi-selections over visual rectangle of characters. In this mode, one line can have 6 chars selected, and another line can have 8 chars selected. This depends on visual positions of chars in those lines.
3053+
3054+ * Value "false": in this mode, all affected lines have the same number of selected chars. But when full-width chars (e.g. CJK) are present in text, selection may look weird. Here is an example picture where starting lines are ASCII and ending lines have full-width chars.
3055+
3056+[![cudatext-column-sel-cjk.png](/wiki-images/d/d5/cudatext-column-sel-cjk.png)](</File:cudatext-column-sel-cjk.png>)
3057+
3058+It is not a bug. In this example, user selected column block from column 7 (at line 1) until column 20 (at line 6), so column block takes columns 7...20 from all lines. On first ASCII lines, columns 7...20 take different visual area, than columns on last lines. When you copy/paste that block to another program, block may look differently. But that block contains equal number of chars on each line.
3059+
3060+Even more weird look happens when user selects column block over word-wrapped lines.
3061+
3062+[![cudatext-column-sel-weird.png](/wiki-images/5/52/cudatext-column-sel-weird.png)](</File:cudatext-column-sel-weird.png>)
3063+
3064+Here is the program's logic in all these cases (with full-width characters and with word-wrapped lines). Program calculates (line1, column1) text position of column block left-top edge. Then program calculates (line2, column2) text position of column block right-bottom edge. Then program selects characters in range column1...column2 in all those affected lines line1...line2. And this program logic produces so weird look in word-wrapped mode.
3065+
3066+## How to replace from/to text containing line-breaks
3067+
3068+There are several ways to perform it:
3069+
3070+1\. The simplest way: set multi-line mode in the Find/Replace dialog, using "+" button. Input fields will become tall and multi-line. To enter line-breaks there, press Ctrl+Enter.
3071+
3072+2\. Use plugin CudaExt:
3073+
3074+ * Select fragment in editor (can contain line-breaks), "what to replace" .
3075+ * Copy to clipboard the fragment (can contain line-breaks), which will be "replacement".
3076+ * Call command in CudaExt plugin: "Replace all occurrences of selected string with clipbrd".
3077+
3078+3\. Search for selected editor text (can contain line-breaks) using command "find current selection, next".
3079+
3080+4\. Copy fragment (can contain line-breaks) which you need to find, to clipboard. Call command in CudaExt plugin: "Find clipbrd: next".
3081+
3082+## How to create macros and call them via toolbar
3083+
3084+Q: I've used Boxer Editor for over a decade. Its strength is you can create macros that can be assigned to buttons that you can place onto the toolbar. I don’t know of any other text editors that can do that. ?
3085+
3086+This can be done in CudaText like this:
3087+
3088+ * Install plugin "Macros". Restart CudaText.
3089+ * Use new menu "Macros" in the top menu, to record some macro(s). This will create command(s) "plugin: Macros: ..." in the Command Palette.
3090+ * Install plugin "Config Toolbar".
3091+ * Call config dialog via "Plugins / Config Toolbar / Configure buttons". In that dialog, add a button. In the button properties, choose your recorded macro command ("Choose command" button). This will add toolbar button for your macro. Customize this button as you wish (any icon, caption, tooltip).
3092+
3093+## How command "Paste and indent" works
3094+
3095+Command "Edit / Paste and indent" should mimic the Sublime Text command with the same name. How it works? For single line clipboard text, it does the same as usual "Paste". For multi-line clipboard text (let's name it "block"), it aligns all lines of the "block", so that lines 2,3,4,... of the "block" will have the same indentation as the first "block" line. If lines had different indents in the clipboard, **relative indents** will be kept.
3096+
3097+Example: clipboard "block" is:
3098+```
3099+aaaaaaaaaaaaaaaa
3100+ aaaaaaaaaaaaaaaa
3101+ bbbbbbbbbbbbbb
3102+ bbbbbbbbbbbbbb
3103+ cccccccccccc
3104+ cccccccccccc
3105+ dddddddddddddddd
3106+```
3107+
3108+And caret ("|" symbol) is located here:
3109+```
3110+some file text
3111+ some file text
3112+ |
3113+```
3114+
3115+"Paste and indent" with such caret position will give this:
3116+```
3117+some file text
3118+ some file text
3119+ aaaaaaaaaaaaaaaa
3120+ aaaaaaaaaaaaaaaa
3121+ bbbbbbbbbbbbbb
3122+ bbbbbbbbbbbbbb
3123+ cccccccccccc
3124+ cccccccccccc
3125+ dddddddddddddddd
3126+```
3127+
3128+## Why XML document is not fully highlighted by XML lexer
3129+
3130+Sometimes, you can see the poor syntax highlighting in XML documents. It is poorer than the "normal" highlighting in the "Lexer properties" dialog.
3131+
3132+What is the reason? The reason is the blocking option
3133+```
3134+"lexer_folding_max_lines": 10000
3135+```
3136+
3137+You load the big XML document, with line count > 10k, and option blocks the "folding" in this document. It causes the lexer to miss folding ranges, and part of the syntax highlight depends on that (the angled brackets are still highlighted). You need to adjust that option to a bigger value.
3138+
3139+Also note that CudaText has the "lite" lexer "XML ^", which is activated for too big XML files. The blocking option is:
3140+```
3141+"ui_max_size_lexer": 2
3142+```
3143+
3144+With the active "lite" lexer (when statusbar shows "XML ^"), syntax highlight is also not very rich, and there is no folding.
3145+
3146+## How to check the rendering speed
3147+
3148+There is hidden option in user.json:
3149+```
3150+"log_timing": true
3151+```
3152+
3153+It shows the additional label in the editor corner, with red font. Label shows the time of the last rendered frame in milliseconds. Label also shows the counter of rendered frames, so developers can check if editor does redundant repaints. Label also shows 3 moving graphs:
3154+
3155+ * red color: total time of rendering
3156+ * blue color: time spent on TextOut/ExtTextOut Lazarus API
3157+ * green color: time spent on minimap rendering
3158+
3159+For text editing commands (e.g. typing of text), counter may increase by 3 on each command. Why? 3rd repaint is from `"bracket_highlight":true` (occurs in IdleTimer after a small delay), 2nd repaint is from lexer parser - parser makes the repaint when full document is parsed or the current screen is parsed. 1st repaint is the main immediate repaint.
3160+
3161+For caret moving commands, counter may increase by 2 on each command. 2nd repaint is from `"bracket_highlight":true`. 2nd repaint may occur also from the auto-showing of the horizontal scrollbar.
3162+
3163+## How to force file saving to append extension .cfg to filename
3164+
3165+Q: I'm looking for a way for newly created files to be auto-saved with a predefined extension. In my case, it is ".cfg". When I open a new blank tab and then "Save As", I want my file to be saved with a specific extension type, if I write it out in the textbox. As an example, I could write out "Test-File-001.json" and the file would be named like this. If I DON'T specify an extension type I want the file extension to automatically be ".cfg". In this second use-case, I would simply write out "Test-File-001" (without an extension type) and CudaText would save my file as "Test-File-001.cfg".
3166+
3167+A: This can be solved with an fake lexer. Create file "Cfg.lcf" in the folder "data/lexlib" with such contents:
3168+```
3169+object SyntAnal21: TLibSyntAnalyzer
3170+ Extentions = 'cfg'
3171+ LexerName = 'Cfg'
3172+ end
3173+```
3174+
3175+Then set the option in user.json:
3176+```
3177+"newdoc_lexer": "Cfg",
3178+```
3179+
3180+## How to open big files in text viewer, without confirmation dialog
3181+
3182+Q: I want to open too big files (e.g. size bigger than 10Mb) using internal text viewer, without asking each time about it.
3183+
3184+A: Here is primitive plugin. Adjust the size limit in the Python code.
3185+
3186+File `py/cuda_big_to_viewer/install.inf`
3187+```
3188+[info]
3189+ title=Big Files to Viewer
3190+ desc=(Fill the description)
3191+ type=cudatext-plugin
3192+ subdir=cuda_big_to_viewer
3193+ homepage=(Fill the GitHub repo URL)
3194+
3195+ [item1]
3196+ section=events
3197+ events=on_open_pre
3198+```
3199+
3200+File `py/cuda_big_to_viewer/__init__.py`
3201+```
3202+import os
3203+ from cudatext import *
3204+
3205+ BIG_SIZE_IN_MB = 10
3206+
3207+ class Command:
3208+
3209+ def on_open_pre(self, ed_self, filename):
3210+ nsize = os.path.getsize(filename)
3211+ if nsize>=BIG_SIZE_IN_MB*1024*1024:
3212+ file_open(filename, options='/view-text')
3213+ print('Forced viewer for file: '+filename)
3214+ return False
3215+```
3216+
3217+## Windows: Auto-completion doesn't work on Chinese system
3218+
3219+Some users have a problem activating auto-completion by Ctrl+Space (default hotkey) on CJK systems.
3220+
3221+Grok AI knows the reason: The reason Ctrl+Space doesn't trigger auto-completion in CudaText (when editing an HTML file) while Microsoft Pinyin IME is active is a classic and very annoying conflict that's existed in Windows for many years. When the Microsoft Pinyin IME (the default Chinese input method for Simplified Chinese) is active (i.e. the input mode shows Chinese/中), Windows steals the Ctrl+Space keystroke at a very low system level and uses it as the default hotkey to toggle between Chinese and English input modes (中 ↔ 英 / A). This happens before the keystroke ever reaches CudaText → CudaText never sees Ctrl+Space → auto-completion (which uses Ctrl+Space by default) doesn't open.
3222+
3223+**Quick summary — why this happens especially often with Chinese users**
3224+
3225+ * Many editors/IDEs use Ctrl+Space for completion (VS Code, IntelliJ, Eclipse, CudaText, etc.)
3226+ * Microsoft kept Ctrl+Space as default toggle for Chinese IME for historical compatibility.
3227+ * Even if you disable or change the hotkey in Language Settings → Advanced keyboard settings, it often silently reverts or doesn't fully apply (very well-known Windows bug).
3228+
3229+**How to solve it (most reliable methods in 2025–2026)**
3230+
3231+Pick one (usually the first or second works best):
3232+
3233+1\. **Best quick fix** — just switch IME to English mode before using completion
3234+
3235+While Microsoft Pinyin is active, press Shift (single press) or Ctrl+Shift → IME switches to English (shows A/英) → Ctrl+Space in CudaText starts working normally again.
3236+
3237+2\. **Disable "old version" compatibility mode** (surprisingly fixes it for many people in recent Windows versions)
3238+
3239+Settings → Time & Language → Language & region → Chinese → Options → Microsoft Pinyin → General → Turn OFF the option "Use previous version of Microsoft Pinyin".
3240+
3241+Many users report that this alone makes Ctrl+Space stop being stolen.
3242+
3243+3\. **Change or disable the toggle hotkey** (the official way, but often unreliable)
3244+
3245+Settings → Time & Language → Typing → Advanced keyboard settings → Input language hot keys → Change "Between input languages" or "Chinese (Simplified, China) - Microsoft Pinyin" toggle → Set it to something else (e.g. Ctrl+Shift+Z or none) → Log out and log back in (very important — changes usually don't apply immediately).
3246+
3247+## Windows: Substitute another font for missing font characters
3248+
3249+In many fonts, many Unicode characters are missing. This gives problem on Windows 10/11: these characters will be omitted in the rendered result, because CudaText uses GDI rendering system.
3250+
3251+But solution for Windows 10/11 exists. User can specify "fallback" fonts. Run "regedit.exe", navigate to the registry folder:
3252+```
3253+HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink
3254+```
3255+
3256+and modify the key there. For example, if you miss CJK chars, and you use font "Consolas", create registry key "Consolas", and set fallback for it:
3257+```
3258+msyh.ttc,Microsoft YaHei UI
3259+```
3260+
3261+This way, when font "Consolas" renders missing words, it fallbacks to "Microsoft Yahei" font.
3262+
3263+Full info about this registry feature: <https://learn.microsoft.com/en-us/globalization/fonts-layout/fonts>
3264+
3265+# Troubleshooting the Windows shell extension for CudaText
3266+
3267+There may be rare cases where CudaText's menu item shows up in Windows Explorer context menu but the entry's icon is missing and an error message states that the provided file name was not found.
3268+
3269+## File sets information
3270+
3271+If you download a 32 bit version of CudaText, you will notice that there are two sets of files belonging to the shell extension.
3272+
3273+Set 1 consists of these files:
3274+
3275+ * CudaText_shell32.dll
3276+ * install_shell32.cmd
3277+ * uninstall_shell32.cmd
3278+
3279+Set 2 consists of these files:
3280+
3281+ * CudaText_shell64.dll
3282+ * install_shell64.cmd
3283+ * uninstall_shell64.cmd
3284+
3285+Since 32 bit versions of CudaText can be run on both 32 bit and 64 bit versions of Windows, two sets of files are needed. Use set 1 if you run CudaText on a 32 bit version and set 2 if you run it on a 64 bit version of Windows.
3286+
3287+The download package of CudaText 64 bit contains only set 2 since this version can only be run on a 64 bit version of Windows.
3288+
3289+**Please note:** It is _not_ possible to install the 32 bit version of the shell extension on 64 bit Windows or vice versa.
3290+
3291+## Common information
3292+
3293+The context menu item works for all types of files, folders, disk drives, desktop links to these items, the desktop background and the background of an Explorer window showing a folder's content. Other kinds of right-clicked items don't show the context menu item.
3294+
3295+The context menu entry's icon is extracted from the file "cudatext.exe", the absence of the icon indicates that "cudatext.exe" wasn't found by the shell extension. That's also the reason for the error message mentioned above.
3296+
3297+## Fixing installation error
3298+
3299+**Please note:** In the following only the 64 bit version of the shell extension running on 64 bit Windows is dealt with. If you want to install the 32 bit shell extension on 32 bit Windows you have to select the appropriate file names.
3300+
3301+In case a suitable item has been right-clicked and the icon is missing from the context menu item, it is possible to install the shell extension manually. To do that please follow the steps below.
3302+
3303+At first ensure that all the files
3304+
3305+ * cudatext.exe
3306+ * CudaText_shell64.dll
3307+ * install_shell64.cmd
3308+ * uninstall_shell64.cmd
3309+
3310+are stored in the same folder.
3311+
3312+Start a Windows console with administrative permissions. If you don't know how to do that search the internet to learn it.
3313+
3314+Use the "CD" command to navigate to the folder where the above files are stored (it should be your CudaText folder). You should end up with a command prompt that looks for example like this:
3315+```
3316+C:\cudatext>
3317+```
3318+
3319+Type the following command into your console window and hit Enter:
3320+```
3321+regsvr32 /u "<Path-to-CudaText-folder>\cudatext_shell64.dll"
3322+```
3323+
3324+This uninstalls the failing shell extension. You should see a confirmation message that indicates a successful deregistration of the DLL.
3325+
3326+Close all programs and log off or restart Windows. Login in again and ensure that the CudaText context menu item has disappeared.
3327+
3328+Start a Windows console with administrative permissions again and use the "CD" command to navigate to your CudaText folder (the folder where the above files are stored).
3329+
3330+Type the following command into your console window and hit Enter:
3331+```
3332+regsvr32 "<Path-to-CudaText-folder>\cudatext_shell64.dll"
3333+```
3334+
3335+You should see a confirmation message that indicates a successful registration of the DLL. Check the Explorer context menu to see if there is a CudaText menu item that has an icon. Right click for example a *.txt file and select "Open with CudaText" from the context menu.
3336+ *[LSP]: Language Server Protocol
3337+ *[PCRE]: Perl Compatible Regular Expressions
3338+ *[ABAP]: Advanced Business Application Programming
3339+ *[Adept]: Automatic Differentiation using Expression Templates
3340+ *[AMPL]: A Mathematical Programming Language
3341+ *[ANTLR]: ANother Tool for Language Recognition
3342+ *[APDL]: Ansys Parametric Design Language
3343+
3344+---
3345+*From the Free Pascal wiki, page "CudaText", as the Internet Archive kept it on 2026-03-22, last changed on 2026-02-21. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history