-
mini.nvim
Library of 35+ independent Lua modules improving overall Neovim (version 0.7 and higher) experience with minimal effort
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
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, af, a?, and more), and allows user to create their own.
For builtin ones it is not. It uses a designed algorithm to find a best match based on several Lua patterns (or similarly behaved Lua functions). Mainly because: - 'mini.ai' is mostly aimed for plain text textobjects which are useful most of the times (brackets, quotes, underscores, etc). Function calls (not definitions) and arguments are added because I tend to use them all the time. With this Lua pattern approach I found it works like 199 times out of 200 (mostly because they are more or less same across languages). Which is good enough for me. - Working with treesitter requires a careful bookkeeping of a lot of language-specific queries. This is what nvim-treesitter/nvim-treesitter-textobjects does. 'mini.nvim' is aimed to not do language-specific functionality. I currently use nvim-treesitter-textobjects for function definition textobjects, for example. But that is also can be replaced with "indentation" textobject from 'mini.indentscope' in about 99 times out of 100. - Using treesitter based solution will not work inside comments and strings (and buffers without dedicated treesitter captures, of course). Which is a fair bit of usage and I remember it was annoying when I tried to use it.
Related posts
-
Function and class text objects with Treesitter?
-
Moving to text object
-
'mini.surround' new features - tree-sitter support, "last"/"next" extended mappings, aliases, and more
-
'mini.ai' now supports textobjects based on tree-sitter
-
Question: Is it a requirement that plugins written in Lua require you to call the setup function?