Announcing ‘mini.ai’

announce
reddit
Extend and create a/i textobjects (like ‘targets.vim’, but in Lua and a bit different)
Author

Evgeni Chasnovski

Published

July 28, 2022

Originally posted on Reddit

Hello, Neovim users!

I am incredibly happy to announce mini.ai - module #20 of mini.nvim for extending and creating a/i textobjects (like in di( or va"). It enhances some builtin textobjects (like a(, a), a', and more), creates new ones (like a*, a<Space>, af, a?, and more), and allows user to create their own.

Features:

More information can be found in help file. Here are some examples of which textobjects can be defined with ‘mini.ai’.

This was the first module request I got for ‘mini.nvim’, and I happy to finally implement it. Initially I planned this to have the same “backend” as mini.surround. But then I got an idea about slight change in textobject definition and algorithm, which enabled many more powerful textobjects (like aliases, etc.). After ‘mini.ai’ is publicly beta-tested, I plan to move its logic to ‘mini.surround’ (which will lead to some graceful soft deprecation of current custom textobject definition).

Try it out and tell me your thoughts! Either here or in dedicated beta-testing issue. I am especially interested in your thoughts about default textobjects (more info in beta-testing issue).

Also simply sharing information about ‘mini.nvim’ plugin is a huge help. Thanks!