@CleoMenezesJr to anyone telling you they can do the same with multicursors, tell them you can apply this kind of change in 100 files with no effort.. Good luck doing that with multicursors
@bew @CleoMenezesJr I’d like to see someone do *this* with multi-cursors: https://normalmo.de/vimlife/
@normalmode How did you manage to make conditionals with macros?
I have this usecase sometimes to do a part of a macro only if some char is there, but IIRC (neo)vim cancels the macro execution when `f,` is not working for example
@bew By figuring out ways to get the cursor to move to the position of the code for each of the branches. It’s kind of hard to describe without going into gory detail, but if you’re able to read her Twitter thread, Pelafina Lievre breaks down the entire thing really clearly.
If you liked it, you should check out my other macro constructions! http://normalmo.de/categories/fun-with-macros
@bew You basically can’t. The techniques I came up with to workaround this aren’t really practical to use in general day-to-day editing, I’m afraid.
@bew Okay, I think I figured out how to handle `f,` but… you’re not going to like it…
If you’d like to give me a bit more context I can show you exactly how to do it: otherwise I’ll come up with a contrived example.
This is for a blog post, so let me know if you’re happy to be credited there and if I can use your example.
@normalmode Honestly it's been a while since I needed this kind of thing
Go with a contrived example, or share what you're thinking maybe ¯\_(ツ)_/¯
@bew Sorry for the delay. I actually wrote the macro the day we spoke about this, but finishing the blog post seems to have taken a little bit longer!
@normalmode no worries, that's definitely a crazy hack ^^
Thanks for the blog post explaining it that well!