Announcing ‘mini.operators’
Originally posted on Reddit
Hello, Neovim users!
I am overjoyed to release mini.operators - new module of mini.nvim with various text edit operators. It can also be installed using separate GitHub repository.
Initially I planned to do a ‘mini.exchange’ module for only “exchange” operator. After exploration of other useful operators, I got a little excited with possibilities. As they all mostly fit into “various text edit operators” category, I decided to upgrade my plans to include more operators.
At first, some of them didn’t seem that useful, but continuous practice unveiled interesting minor “quality of life” improvements in frequent mundane tasks:
Dot-repeatability of “replace” operator really adds up for several quick replacements.
Hitting
grr
/gmm
to replace/multiply current line feels more ergonomic thanVP
/yyp
. Plus they reuse current indent (which often saves extra keystrokes) and don’t affect"
register.“Evaluate” operator is really useful for exploring some big Lua object inside a buffer and is slightly quicker to use than
put_text()
from ‘mini.misc’.
Here are main features of ‘mini.operators’:
Operators:
- Evaluate text and replace with output.
- Exchange text regions.
- Multiply (duplicate) text.
- Replace text with register.
- Sort text.
Automated configurable mappings to operate on textobject, line, selection. Can be disabled in favor of more control with
MiniOperators.make_mappings()
.All operators support
[count]
and dot-repeat.
See MiniOperators-overview and MiniOperators.config for more details.
For full documentation see help file.
Please, check it out and tell me what you think! You can leave your suggestions either here in comments or in dedicated beta-testing issue.
Thanks!