feat: consistent prompt symbols for all pickers

This commit is contained in:
Folke Lemaitre 2024-06-10 20:44:32 +02:00
parent dd5a5fb4cd
commit 0d05715411
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -31,7 +31,7 @@ return {
{ {
"ibhagwan/fzf-lua", "ibhagwan/fzf-lua",
event = "VeryLazy", event = "VeryLazy",
opts = function() opts = function(_, opts)
local config = require("fzf-lua.config") local config = require("fzf-lua.config")
local actions = require("fzf-lua.actions") local actions = require("fzf-lua.actions")
@ -51,10 +51,22 @@ return {
end end
config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"] config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"]
return { -- use the same prompt for all
[1] = "default-title", local defaults = require("fzf-lua.profiles.default-title")
local function fix(t)
t.prompt = t.prompt ~= nil and "" or nil
for _, v in pairs(t) do
if type(v) == "table" then
fix(v)
end
end
end
fix(defaults)
return vim.tbl_deep_extend("force", opts, defaults, {
fzf_colors = true, fzf_colors = true,
files = { files = {
cwd_prompt = false,
actions = { actions = {
["alt-i"] = { actions.toggle_ignore }, ["alt-i"] = { actions.toggle_ignore },
["alt-h"] = { actions.toggle_hidden }, ["alt-h"] = { actions.toggle_hidden },
@ -66,7 +78,7 @@ return {
["alt-h"] = { actions.toggle_hidden }, ["alt-h"] = { actions.toggle_hidden },
}, },
}, },
} })
end, end,
keys = { keys = {
{ "<esc>", "<cmd>close<cr>", ft = "fzf", mode = "t", nowait = true }, { "<esc>", "<cmd>close<cr>", ft = "fzf", mode = "t", nowait = true },