nvim-mini / nvim-mini/mini.nvim

Repeatable movement across modules with `;` and `,`

Open
#1,077 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new-module
Dominant language
Lua
Stars
9.5k
Forks
310
Avg merge
4h 16m
Merged PRs (30d)
1

Description

Contributing guidelines
Module(s)

mini.jump, mini.ai, mini.bracketed

Description

Hi, and thank you for this incredible project, it is slowly conquering my config :)

I think it would be cool if modules that deal with movements were able to make them repeatable with , and ;. Some examples of this behaviour would be:

  • with mini.bracketed, pressing ]i takes you to the next indent, and pressing ; afterwards takes you to the next one again. Pressing , would instead bring you to the previous one. Same could be done with the movements that are local to the buffer, such as treesitter nodes, diagnostics, comment blocks etc.
  • with mini.ai, pressing g[' takes you to the first quote in a pair, pressing ; afterwards does it again. This is also implented in nvim-treesitter/nvim-treesitter-textobjects
  • with mini.jump, this is already working with the ; key. It would be a matter of integrating it with the general mechanism used for the other modules.

There is an implementation of this in https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/master/lua/nvim-treesitter/textobjects/repeatable_move.lua
It is written so that other plugins can hook into it, making their respective moves repeatable, but I feel like such a mechanism would be better suited to a project like this, as it is more general in scope and it already has many modules it can be hooked into.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the referenced nvim-treesitter/textobjects repeatable_move.lua implementation, then inspect the movement behavior described for mini.jump, mini.ai, and mini.bracketed. Done means the modules can use a shared mechanism to repeat their movements with ; and reverse them with ,, including the examples in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.