Page 1 of 1

Snippets replace plugin?

Posted: 14.06.2019 23:14
by doesnotcompute29
Hi. I'm wondering if Cudatext has a snippets replace addon where you can highlight a word, and then replace that word. I know it has a find/replace function, but is there a quicker way to do that? Thanks!

Posted: 15.06.2019 08:56
by Alexey
You can use "Snippets Panel" plugin (it has button in sidebar). To add your words to plugin, see plugin's readme:
gives command "Plugins - Snippets Panel" to show panel, in sidebar, similar to Clips panel from SynWrite editor. this panel shows drop-down list of folders, which contain several "clips"/"snippets". you can double-click snippets to insert them into text (multi-carets are supported).

preinstalled folders:
- Arrows
- Currency symbols
- Greek alphabet (lower)
- Greek alphabet (upper)
- HTML - Arrows
- HTML - Color names
- HTML - Color names+values
- HTML - Letters
- HTML - Math symbols
- HTML - Special characters
- Math symbols
- Quote selection
- Special characters

snippet folders are searched in 2 places:
- folder "clips" in plugin folder (preinstalled)
- folder [CudaText]/data/clips, which is absent by default, for custom user folders.

each snippet folder can contain one or more .txt files, in UTF-8 (no BOM) or UTF-16 (with BOM) encoding. files have snippet per line, in the form "name=value" or simply "name" (if value missed, it equals to name).
each snippet can be simple short string, or string with ${sel} macro to replace selected text. this allows to quote currently selected text by calling snippets from "Quote selection" folder.

Posted: 24.06.2019 03:53
by doesnotcompute29
I looked in my data folder, where Cudatext is installed, but I didn't see a clip folder. I did find a snippet folder, but no clip was in there, either. Do I need to re-install clip? And for the .txt file, do I write the words in the file, and then save it in the folder?

Posted: 24.06.2019 17:27
by Alexey
Name 'clips' with 's'. It is absent for all, just create such folder. Create txt files and save in there. Plugin will detect that files.