{
"cpea2506/input.nvim"
}- Neovim >= 0.12.0
This plugin works immediately after installation. Configuration is optional, only needed if you want to override defaults.
| Option | Description | Type | Notes |
|---|---|---|---|
icon |
Icon displayed next to the prompt | string |
N/A |
default_prompt |
Default text for the prompt | string |
N/A |
win_options |
Window-level Vim options | table<string, any> |
See :h nvim_win_set_option |
win_config |
Window configuration for nvim_open_win |
table<string, any> |
See :h nvim_open_win |
size_options |
Dynamic sizing configuration | table |
See Size Options |
| Option | Description | Type | Notes |
|---|---|---|---|
width.min |
Minimum width of the input window | integer |
N/A |
width.max |
Maximum width of the input window | integer |
N/A |
height.min |
Minimum height of the input window | integer |
N/A |
height.max |
Maximum height of the input window | integer |
N/A |
require("input").setup({
icon = "",
default_prompt = "Input",
win_options = {
wrap = true,
linebreak = true,
winhighlight = "Search:None",
},
win_config = {
relative = "cursor",
anchor = "NW",
border = vim.o.winborder,
row = 1,
col = -1,
width = 1,
height = 1,
style = "minimal",
},
size_options = {
width = {
min = 40,
max = 60,
},
height = {
min = 1,
max = 6,
},
},
})These are the default key mappings:
| Keybinding | Mode(s) | Action |
|---|---|---|
<C-c> |
i, n | Cancel content changes and close input |
<Esc> |
n | Cancel content changes and close input |
q |
n | Cancel content changes and close input |
<CR> |
i, n | Confirm content changes and close input |
| Highlight Group | Purpose |
|---|---|
InputIcon |
Status column icon, which displayed before the prompt |
To customize highlights for the plugin window:
require("input").setup({
win_options = {
winhighlight = "NormalFloat:DiagnosticError"
}
})For more, see :h winhighlight.
For detailed instructions on how to contribute to this plugin, please see the contributing guidelines.
