[](https://github.com/echasnovski/mini.nvim/blob/main/LICENSE)
### Pick anything
See more details in [Features](#features) and [help file](../doc/mini-pick.txt).
---
⦿ This is a part of [mini.nvim](https://github.com/echasnovski/mini.nvim) library. Please use [this link](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pick.md) if you want to mention this module.
⦿ All contributions (issues, pull requests, discussions, etc.) are done inside of 'mini.nvim'.
⦿ See the repository page to learn about common design principles and configuration recipes.
---
If you want to help this project grow but don't know where to start, check out [contributing guides of 'mini.nvim'](https://github.com/echasnovski/mini.nvim/blob/main/CONTRIBUTING.md) or leave a Github star for 'mini.nvim' project and/or any its standalone Git repositories.
## Demo
https://github.com/echasnovski/mini.nvim/assets/24854248/65849d1e-3f96-4085-a4cf-f9962cfdbdfd
## Features
- Single window general purpose interface for picking element from any array.
- On demand toggleable preview and info views.
- Interactive query matching (filter+sort) with fast non-blocking default which does fuzzy matching and allows other modes.
- Built-in pickers:
- Files.
- Pattern match (for fixed pattern and with live feedback).
- Buffers.
- Help tags.
- CLI output.
- Resume latest picker.
- `:Pick` command to work with extensible `MiniPick.registry`.
- `vim.ui.select()` wrapper.
- Rich and customizable built-in actions when picker is active:
- Manually change currently focused item.
- Scroll vertically and horizontally.
- Toggle preview or info view.
- Mark/unmark items to choose later.
- Refine current matches (make them part of a new picker).
- And many more.
- Minimal yet flexible source specification with:
- Items (array, callable, or manually set later).
- Source name.
- Working directory.
- Matching algorithm.
- Way matches are shown in main window.
- Item preview.
- "On choice" action for current and marked items.
- Custom actions/keys can be configured globally, per buffer, or per picker.
- Out of the box support for 'ignorecase' and 'smartcase'.
- Match caching to increase responsiveness on repeated prompts.
Notes:
- Works on all supported versions but using Neovim>=0.9 is recommended. Neovim>=0.10 will give more visual feedback in floating window footer.
- For more pickers see ['mini.extra'](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-extra.md).
- CLI tools are called only with basic arguments needed to get items. To customize the output, use their respective configuration approaches. Here are some examples of where to start:
- [ripgrep](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file)
- [fd](https://github.com/sharkdp/fd#excluding-specific-files-or-directories)
- [git](https://git-scm.com/docs/gitignore)
Read more information, see these tags in help file:
- `*MiniPick-overview*`
- `*MiniPick-source*`
- `*MiniPick-actions*`
- `*MiniPick-examples*`
- `*MiniPick.builtin*`
## Dependencies
For full experience needs (still works without any of suggestions):
- Enabled ['mini.icons'](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-icons.md) module for icons near the items representing actual paths. Can fall back to using [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) plugin.
- Executable [BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep) CLI tool for faster file and pattern search on disk.
## Overview
General idea is to take array of objects, display them with interactive filter/sort/navigate/preview, and allow to choose one or more items.
### How to start a picker
- Use `MiniPick.start()` with `opts.source` defining source.| Github repo | Branch | Code snippet |
|---|---|---|
| 'mini.nvim' library | Main | Follow recommended 'mini.deps' installation |
| Stable | ||
| Standalone plugin | Main | add('echasnovski/mini.pick') |
| Stable | add({ source = 'echasnovski/mini.pick', checkout = 'stable' }) |
| Github repo | Branch | Code snippet |
|---|---|---|
| 'mini.nvim' library | Main | { 'echasnovski/mini.nvim', version = false }, |
| Stable | { 'echasnovski/mini.nvim', version = '*' }, |
|
| Standalone plugin | Main | { 'echasnovski/mini.pick', version = false }, |
| Stable | { 'echasnovski/mini.pick', version = '*' }, |
| Github repo | Branch | Code snippet |
|---|---|---|
| 'mini.nvim' library | Main | Plug 'echasnovski/mini.nvim' |
| Stable | Plug 'echasnovski/mini.nvim', { 'branch': 'stable' } |
|
| Standalone plugin | Main | Plug 'echasnovski/mini.pick' |
| Stable | Plug 'echasnovski/mini.pick', { 'branch': 'stable' } |