[mini.ai] The perfect mini-word textobject #1434
Replies: 2 comments 1 reply
-
I'd be interested to hear if anyone thinks the regex can be simplified. It took me quite a while to understand what it was doing (especially the %f pattern) but I could very likely be missing some opportunity for further improvement. |
Beta Was this translation helpful? Give feedback.
-
Nice job of "translating" Lua patterns into regular English :) As with any regex-like systems, first time encountering them can be daunting. It gets easier with time. The example was mostly added as a demo of capabilities for what looks like a popular textobject. I personally don't like using it as it feels "too magical". Regular Vim/Neovim operators textobjects together with |
Beta Was this translation helpful? Give feedback.
-
In the mini.ai help file, there's this custom textobject example:
I absolutely love this textobject and use it to rename variables/functions all the time. However, it has problems:
So, here's my updated version that fixes these issues with sufficient comments. It supports, as far as I can tell, all text cases and capitalizations:
Trust me, you will not regret this. This is one of the biggest quality-of-life improvements I've had with vim editing yet. Take a look:
perfect-textobj.mp4
Beta Was this translation helpful? Give feedback.
All reactions