readmes/mini-cmdline.md
See more details in Features and Documentation.
⦿ This is a part of mini.nvim library. Please use this link if you want to mention this module.
⦿ All contributions (issues, pull requests, discussions, etc.) are done inside of 'mini.nvim'.
⦿ See whole library documentation to learn about general design principles, disable/configuration recipes, and more.
⦿ See MiniMax for a full config example that uses this module.
If you want to help this project grow but don't know where to start, check out contributing guides of 'mini.nvim' or leave a Github star for 'mini.nvim' project and/or any its standalone Git repositories.
https://github.com/user-attachments/assets/9d3e12ac-ff17-4bdb-bbe8-3010c966c110
Autocomplete with customizable delay. Enhances :h cmdline-completion and manual :h 'wildchar' pressing experience. Requires Neovim>=0.11, though Neovim>=0.12 is recommended.
Autocorrect words as-you-type. Only words that must come from a fixed set of candidates (like commands and options) are autocorrected by default.
Autopeek command range as-you-type. Shows a floating window with range lines along with customizable context lines.
What it doesn't do:
Customization of command line UI. Use :h vim._extui (on Neovim>=0.12).
Customization of autocompletion candidates. They are computed via :h cmdline-completion.
This plugin can be installed as part of 'mini.nvim' library (recommended) or as a standalone Git repository.
During beta-testing phase there is only one branch to install from:
main (default, recommended) will have latest development version of plugin. All changes since last stable release should be perceived as being in beta testing phase (meaning they already passed alpha-testing and are moderately settled).stable will be updated only upon releases with code tested during public beta-testing phase in main branch.Here are code snippets for some common installation methods (use only one):
<details> <summary>With <a href="https://nvim-mini.org/mini.nvim/readmes/mini-deps">mini.deps</a></summary>'mini.nvim' library:
| Branch | Code snippet |
|---|---|
| Main | Follow recommended 'mini.deps' installation |
| Stable | Follow recommended 'mini.deps' installation |
Standalone plugin:
| Branch | Code snippet |
|---|---|
| Main | add('nvim-mini/mini.cmdline') |
| Stable | add({ source = 'nvim-mini/mini.cmdline', checkout = 'stable' }) |
'mini.nvim' library:
| Branch | Code snippet |
|---|---|
| Main | { 'nvim-mini/mini.nvim', version = false }, |
| Stable | { 'nvim-mini/mini.nvim', version = '*' }, |
Standalone plugin:
| Branch | Code snippet |
|---|---|
| Main | { 'nvim-mini/mini.cmdline', version = false }, |
| Stable | { 'nvim-mini/mini.cmdline', version = '*' }, |
'mini.nvim' library:
| Branch | Code snippet |
|---|---|
| Main | Plug 'nvim-mini/mini.nvim' |
| Stable | Plug 'nvim-mini/mini.nvim', { 'branch': 'stable' } |
Standalone plugin:
| Branch | Code snippet |
|---|---|
| Main | Plug 'nvim-mini/mini.cmdline' |
| Stable | Plug 'nvim-mini/mini.cmdline', { 'branch': 'stable' } |
Important: don't forget to call require('mini.cmdline').setup() to enable its functionality.
Note: if you are on Windows, there might be problems with too long file paths (like error: unable to create file <some file name>: Filename too long). Try doing one of the following:
git config --system core.longpaths true. Then try to reinstall.-- No need to copy this inside `setup()`. Will be used automatically.
{
-- Autocompletion: show `:h 'wildmenu'` as you type
autocomplete = {
enable = true,
-- Delay (in ms) after which to trigger completion
-- Neovim>=0.12 is recommended for positive values
delay = 0,
-- Custom rule of when to trigger completion
predicate = nil,
-- Whether to map arrow keys for more consistent wildmenu behavior
map_arrows = true,
},
-- Autocorrection: adjust non-existing words (commands, options, etc.)
autocorrect = {
enable = true,
-- Custom autocorrection rule
func = nil,
},
-- Autopeek: show command's target range in a floating window
autopeek = {
enable = true,
-- Number of lines to show above and below range lines
n_context = 1,
-- Custom rule of when to show peek window
predicate = nil,
-- Window options
window = {
-- Floating window config
config = {},
-- Function to render statuscolumn
statuscolumn = nil,
},
},
}