nvim-mini / nvim-mini/mini.nvim

A module to work with hierarchical text structure

Open
#2,394 1 comment 13 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)

new

Description

The suggested name is 'mini.hierarchy'. In particular:

  • Automatically compute hierarchy of the buffer text based on configurable sources (like "treesitter", "lsp", "indent"). It should be done only when needed, in debounced fashion, and ideally with as little computation as possible. Overall similar to 'mini.diff'.

    The hierarchical structure is a tree-like array of table nodes each containing information about its range, type and/or name, and a recursive array of children nodes (should have ranges inside the parent range). Sibling ranges should intersect, but their union is allowed to not cover the whole parent range (i.e. there can be "empty" spots).

  • Provide functionality that leverages the text hierarchy. Like:

    • Incremental selection in Visual mode: select parent/child/next-sibling/prev-sibling. Probably behind default si / sI / sn / sN mappings.
    • Navigate to start of parent/child/next-sibling/prev-sibling. Probably behind default [{ / ]} / ]] / [[. Not sure how to navigate to their end, as navigate to start/end of the node based only on cursor is not really useful as it will use the smallest node.
    • Possibly textobjects for 'mini.ai'.
    • Compute "current hierarchy branch" to be displayed as the typical "breadcrumbs" in winbar. See #983.
    • Automatically dim parts of text that are not in the "current hierarchy branch". See #2392.
    • Toggle-able overview of the whole tree structure.
    • Fold method that folds based on the nesting level of the "hierarchy node at cursor".

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

No implementation file or test is named. Start by reviewing the existing mini.diff module and the proposed treesitter, LSP, and indent sources, then read the linked issues #983 and #2392. The work is complete only when the scope is defined and a configurable, debounced hierarchy can support the selected navigation, selection, display, dimming, overview, or folding behavior.

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
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.