Announcing ‘mini.bracketed’
Originally posted on Reddit
Hello, Neovim users!
Let me present you mini.bracketed - new module of mini.nvim for going forward/backward with square brackets. It can also be installed using separate GitHub repository.
Initially I planned to make a Neovim take on ‘tpope/vim-unimpaired’ as a part of mini.basics module, but got a bit carried away with features. General idea is to have [ / ] mappings (along with Lua functions) which iterate to next/previous/first/last element of certain kind. Judging by experience, mastering this type of mappings leads to a huge productivity boost (or at least feels like it :) ).
Main features:
Configurable Lua functions to go forward/backward to a certain target. Each function can be customized with direction, number of times, whether to wrap on edges, etc.
Mappings using square brackets. They are created using configurable target suffix and can be selectively disabled.
Supported targets (for more information see help for corresponding Lua function):
Target Mappings Lua function Buffer [B[b]b]BMiniBracketed.buffer()Comment [C[c]c]CMiniBracketed.comment()Conflict [X[x]x]XMiniBracketed.conflict()Diagnostic [D[d]d]DMiniBracketed.diagnostic()File on disk [F[f]f]FMiniBracketed.file()Indent [I[i]i]IMiniBracketed.indent()Jump [J[j]j]JMiniBracketed.jump()Location [L[l]l]LMiniBracketed.location()Old files [O[o]o]OMiniBracketed.oldfile()Quickfix [Q[q]q]QMiniBracketed.quickfix()Tree-sitter [T[t]t]TMiniBracketed.treesitter()Undo states [U[u]u]UMiniBracketed.undo()Window [W[w]w]WMiniBracketed.window()Yank [Y[y]y]YMiniBracketed.yank()
For more information, see help file.
Besides some obvious ones (buffer, location, quickfix, window, etc.), I am especially excited about the following targets:
oldfile- old files from previous and current sessions ordered by recency.treesitter- move to start/end of current node and its parents.undo- undo to the previous visited undo state; see demo.yank- replace previous paste region with yank history, a.k.a. yank-ring targets.
Please, check it out and tell me what you think! Either here in comments or in dedicated beta-testing issue.
Thanks!