Comment by 🌧️ candycanearter
Re: "The sickest regex I've ever used so far"
i personally dont use macros that much, but i have been meaning to learn how to use them lately... i love the hjkl movement of vim, and the yank/delete stuff
🌧️ candycanearter [✍️ short and simple]
2025-07-21 · 10 months ago
1 Later Comment
👾 jecxjo · 2025-07-21 at 15:55:
The first step you need to get down is navigation. If you aren't navigating your document in more specific strokes then you're not ready for macros. When I navigate the document its all in words and lines and find the next/previous character.
Once you have that down then you can start recording steps as you fix the first instance. Move to the second and play it. The cool thing is that eventually you can start using it in code creation as well. I will often just make a list of all the variables and then record a macro where I convert the single word into the private member variable as well as the getter and setter functions. Then just select the list of names and apply and bam you have your class
Original Post
The sickest regex I've ever used so far — Had a bunch of attributes for ui widgets (same thing as properties in css basically) with c99-style struct initializers that all looked like this: [preformatted] Then I finally got fed up with these long definitions, and decided to just convert them into the following macro form: [preformatted] So basically the same but shorter. And the following command does just that: [preformatted] Pretty sick for a command that was actually used and not just...