nvim-mini / nvim-mini/mini.nvim

Improve 'mini.jump2d' default config and jumping experience

Open
#1,818 10 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request mini.jump2d
Dominant language
Lua
Stars
9.5k
Forks
310
Avg merge
4h 16m
Merged PRs (30d)
1

Description

Contributing guidelines
Module(s)

mini.jump2d

Description
  • Update default config.view to have dim = true and n_steps_ahead = 2 (or 1). These were not default because they were not present in the initial release and their values preserved the current at the time behavior.
  • Consider having default config.labels as 'asdfghjkl;', i.e. 10 "home row" keys. After test driving them it indeed feels more natural and faster to type, but average label length of targets does go up (less labels -> longer sequences).
  • Consider handling <BS> during sequence enter to undo previously typed label.
  • Add something like a "smart jump":
    • May or may not have a separate config.mappings.smart_jumping entry. I currently very much like sj: it is in "home row" and works well with 'mini.surround'. It feels better than <CR> (because hands stay on the home row which makes further typing faster) and is almost feels the same as a single s key (which doesn't work with 'mini.surround' and is a bit wasteful).
    • Requires pressing a single character after initiating. That character represents a "jumper identifier" in a concept similar to "textobject/surrounding identifier" from 'mini.ai' and 'mini.surround'. A single jumper is essentially a start() table input or function returning it. This allows customizing everything for any jumper separately: view, labels, allowed_lines, etc.
    • A default jumper reused config values and sets spotter to jump to a cell containing identifier, like builtin_opts.single_character. Should also respect 'ignorecase' and 'smartcase'.
    • Something like <BS> can be used as "return to previous position", which is a more flexible (yet verbose) way of doing "remote operations": jump (like sj-<char>-<seq>) - do operation - sj<BS>. May require exported MiniJump2d.jump_back().
    • Maybe . identifier can be used as "jump to any punctuation group".
    • Maybe <Space> identifier can be used as "jump to any whitespace or line start".
    • Add config.custom_jumpers to customize jumpers for this "smart jumping".

References: #1033, #1755

cc @pkazmier and @abeldekat about possible ideas/feedback here.

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 mini.jump2d module and its current config, mappings, and jumper handling. The issue contains several separate proposals—default changes, backspace handling, and smart jumping—so first determine which scope has maintainer agreement; done would require implementing the selected behavior and covering its effects in the module's existing tests.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.