A highly experimental general purpose interactive interface for neovim.
Demo.mp4
NOTE:
- This plugin is still under development
- It depends on an experimental feature in neovim nightly (
vim._extui)
This plugin provides an api for an optional unified interactive buffer interface. Instead of having one plugin open a floating popup for fuzzy file search, another showing a completion menu at the bottom, another drawing commandline completions above the status bar and yet another drawing a general purpose picker in a different location, you can choose to have one place where interactive input can be shown that feels native to the editor and is predictable. This includes:
- Running commands with completion.
- Fuzzy finding files or buffers.
- Searching text across a project.
- Input prompts for LSP or Git actions.
- Even interactive plugin UIs (think Telescope, fzf, etc).
- Display timely content (think which-key.nvim or mini.pick)
For Neovim, something like this could replace the ad-hoc popup/floating windows many plugins use, giving us a consistent workflow: a single expandable buffer for all kinds of input and interactive tasks.
The goal of this plugin is to eventually put some form of
lua/minibuffer/core.lua into neovim core if desired by the
maintainers.
Since this interface exists as plugin for now, it will require an
integration layer with other plugins to use their backend. I have
integration implementations in lua/minibuffer/integrations.
neovim >= 0.12(currently on nightly)- Extui enable somewhere early in your init.lua:
require("vim._extui").enable({ enable = true, msg = { target = "msg" } })MAKE SURE YOU HAVE ENABLED vim._extui (See prerequisites)
MiniDeps.now(function()
MiniDeps.add({
source = "simifalaye/minibuffer.nvim",
})
local minibuffer = require("minibuffer")
vim.ui.select = require("minibuffer.builtin.ui_select")
vim.ui.input = require("minibuffer.builtin.ui_input")
vim.keymap.set("n", "<M-;>", require("minibuffer.builtin.cmdline"))
vim.keymap.set("n", "<M-.>", function()
minibuffer.resume(true)
end)
end){
"simifalaye/minibuffer.nvim",
init = function()
local minibuffer = require("minibuffer")
vim.ui.select = require("minibuffer.builtin.ui_select")
vim.ui.input = require("minibuffer.builtin.ui_input")
vim.keymap.set("n", "<M-;>", require("minibuffer.builtin.cmdline"))
vim.keymap.set("n", "<M-.>", function()
minibuffer.resume(true)
end)
end,
}I have written a few usable examples for this interface for demonstration.
vim.keymap.set("n", "<leader>.", require("minibuffer.examples.files"))
vim.keymap.set("n", "<leader>,", require("minibuffer.examples.buffers"))
vim.keymap.set("n", "<leader>/", require("minibuffer.examples.live-grep"))
vim.keymap.set("n", "<leader>o", function()
require("minibuffer.examples.oldfiles")({ cwd = vim.fn.getcwd() })
end)
vim.keymap.set("n", "<leader>O", require("minibuffer.examples.oldfiles"))These integrations are mostly for demonstration purposes as proper support will best happen inside each plugin themselves. Changes to each plugin repo could break the integration.
-- NOTE: after loading plugin
local wk_mb = require("minibuffer.integrations.which-key")
local wk_view = require("which-key.view")
wk_view.show = wk_mb.show
wk_view.hide = wk_mb.hide-- NOTE: after loading plugin
local picker_ui = require("fff.picker_ui")
picker_ui.open = require("minibuffer.integrations.fff")NOTE:
- Not tested with extra pickers found in mini-extra
live-grepdoes not work yet, feel free to use the live-grep picker from the examples
-- NOTE: after loading plugin
local pick_mb = require("minibuffer.integrations.mini-pick")
pick.is_picker_active = pick_mb.is_picker_active
pick.set_picker_items = pick_mb.set_picker_items
pick.start = pick_mb.start