mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
feat(fzf): disable dressing in favor of noice (vim.ui.input) and fzf-lua (vim.ui.select)
This commit is contained in:
parent
14d1ca93d0
commit
5c876b7549
1 changed files with 22 additions and 0 deletions
|
@ -26,6 +26,7 @@ local function symbols_filter(entry, ctx)
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
{ "stevearc/dressing.nvim", enabled = false },
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
|
@ -79,6 +80,23 @@ return {
|
||||||
defaults = {
|
defaults = {
|
||||||
formatter = "path.filename_first",
|
formatter = "path.filename_first",
|
||||||
},
|
},
|
||||||
|
-- Custom LazyVim option to configure vim.ui.select
|
||||||
|
ui_select = function(fzf_opts, items)
|
||||||
|
local title = vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", ""))
|
||||||
|
local width, height ---@type number?, number?
|
||||||
|
if fzf_opts.kind ~= "codeaction" then
|
||||||
|
width, height = 0.5, math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5)
|
||||||
|
end
|
||||||
|
return vim.tbl_deep_extend("force", fzf_opts, {
|
||||||
|
prompt = " ",
|
||||||
|
winopts = {
|
||||||
|
title = " " .. title .. " ",
|
||||||
|
title_pos = "center",
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
winopts = {
|
winopts = {
|
||||||
width = 0.8,
|
width = 0.8,
|
||||||
height = 0.8,
|
height = 0.8,
|
||||||
|
@ -117,6 +135,10 @@ return {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
|
require("fzf-lua").setup(opts)
|
||||||
|
require("fzf-lua").register_ui_select(opts.ui_select or nil)
|
||||||
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<esc>", "<cmd>close<cr>", ft = "fzf", mode = "t", nowait = true },
|
{ "<esc>", "<cmd>close<cr>", ft = "fzf", mode = "t", nowait = true },
|
||||||
{ "<c-j>", "<Down>", ft = "fzf", mode = "t", nowait = true },
|
{ "<c-j>", "<Down>", ft = "fzf", mode = "t", nowait = true },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue