nvim-mini / nvim-mini/mini.nvim

Allow `ˆ` modifier work on line content in `buf_lines` picker

Open
#1,921 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Contributing guidelines
Module(s)

mini.pick

Neovim version

0.11.x

Description

Hello, I have a small issue with the Pick module, and I'm not sure if I'm doing something wrong. Basically, I want to use Pick buf_lines scope="current" to search for specific lines in the current buffer. Specifically, I want to find all lines that start with 'j' followed by a space. Trying with "^j " doesn't work because the line is interpreted as starting with the line number, so the ^ modifier seems less useful in this case. Am I doing something wrong? Is there a way to remove line numbers from the picker's selection window? I know I can use a search or vimgrep to get the same result, but using buf_lines mode is simpler and faster. Thank you very much for your help.

Reproduction
  1. Create separate 'nvim-repro' config directory:

    • '~/.config/nvim-repro/' on Unix
    • '~/AppData/Local/nvim-repro/' on Windows
  2. Inside 'nvim-repro' directory create a file named 'init.lua'.
    Populate it with the following content:

    -- Clone latest 'mini.nvim' (requires Git CLI installed)
    vim.cmd('echo "Installing `mini.nvim`" | redraw')
    local mini_path = vim.fn.stdpath('data') .. '/site/pack/deps/start/mini.nvim'
    local clone_cmd = { 'git', 'clone', '--depth=1', 'https://github.com/echasnovski/mini.nvim', mini_path }
    vim.fn.system(clone_cmd)
    vim.cmd('echo "`mini.nvim` is installed" | redraw')
    
    -- Make sure 'mini.nvim' is available
    vim.cmd('packadd mini.nvim')
    require('mini.deps').setup()
    
    -- Add extra setup steps needed to reproduce the behavior
    -- Use `MiniDeps.add('user/repo')` to install another plugin from GitHub
    
  3. Run NVIM_APPNAME=nvim-repro nvim (i.e. execute nvim with NVIM_APPNAME environment variable set to "nvim-repro").
    Wait for all dependencies to install.

  4. Replace this with description of interactive reproduction steps along with the behavior you observe.
    Feel free to include images/videos/etc, this helps a lot.

What to do after reporting an issue

After reporting the issue, it is safe (and even recommended for cleaner possible future bug reports) to remove 'nvim-repro' config from the system:

  • Delete config directory ('~/.config/nvim-repro' on Unix).
  • Delete data directory ('~/.local/share/nvim-repro' on Unix).
  • Delete state directory ('~/.local/state/nvim-repro' on Unix).

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 with the mini.pick implementation for the Pick buf_lines source and its handling of the ^ modifier and displayed line numbers. Reproduce the search for ^j with scope="current"; done means the modifier can match line content from the beginning of a buffer line without requiring users to account for the picker’s line-number prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.