Why not just save a user-defined dictionary of all your codes in any format you think is best.
I use one where I save all my codes each accompanied with headers so i can find what I need easily, like:
1 #Tags: beta,query,inventory,report,qoh,stock2 #Language: MySQL
3 #Date: 3/26/18
4 #Code:
5 [
6 SELECT * FROM table
7 ]
And if I was to add a search and replace code to this personal library…
8 #Tags: search,find,replace,query 9 #Language: Regular Expression
10 #Date: 3/26/18
11 #Code:
12 [
13 Search= [-·•…:_,~..\s]{3,}
14 Replace= null
15 ]
You can be more detailed than that, but once you find out what works best for you, adding changes to your “Dictionary” or “Library” of codes can get really simple. You can define any keywords you want for the headers and whichever open/close characters separating the code blocks from each other. In my chicken scratch example,I can customize the language to either separate each block by the first bracket to the last bracket or the first hashtag to the last bracket. I’m not too sure about the code folding since I don’t really use that, but I would imagine that is possible.
I also noticed that if you use a tag system like in my example, it would be very difficult to find what you need if you have thousands of code blocks with similar tags. And you can do a regexp find lines that contains all words, but that would just void the purpose of you having to type regular expressions every time. So like I said, you can be more detailed than my example, you can use a naming convention like “regex-find-name” where name is a word or phrase you’d give that function. You could also build your dictionary in a different format that makes searching for multiples words on the same line much easier. A bad recommendation would be excel, but that’s the simplest method I can think of. Write the dictionary in a csv format and run a saved formula to check if all words exist on the same row. But if you have the time, build yourself a small desktop tool with all these functions to build and search your dictionary. Create forms to add to it, search and modify or remove definitions. There’s gotta be a program for this already no!? A personal and highly customizable dictionary?