mini.ai - extend and create a/i textobjects (like 'targets.vim', but in Lua and a bit different)

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/neovim

Our great sponsors
  • Scout APM - Truly a developer’s best friend
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • Zigi - The context switching struggle is real
  • SonarQube - Static code analysis for 29 languages.
  • mini.nvim

    Library of 20+ independent Lua modules improving overall Neovim (version 0.6 and higher) experience with minimal effort

    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.

  • Scout APM

    Truly a developer’s best friend. Scout APM is great for developers who want to find and fix performance issues in their applications. With Scout, we'll take care of the bugs so you can focus on building great things 🚀.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts