Completely change from telescope to fzf, it's way more performant

This commit is contained in:
Martin Larsson 2024-09-16 00:12:30 +02:00
parent 3ecc70e179
commit fc01aa096c
2 changed files with 39 additions and 98 deletions

View file

@ -1,19 +1,47 @@
return {
"ibhagwan/fzf-lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {},
opts = {
"telescope",
winopts = {
preview = {
default = "bat"
}
}
},
config = function()
local fzf = require("fzf-lua")
require("utils").add_keymaps({
n = {
["<leader>to"] = {
cmd = function()
fzf.files({
git_icons = false,
})
end
}
local pickers = {
{
mapping = "o",
action = function()
fzf.files({
git_icons = false,
})
end
},
{
mapping = "a",
action = function()
fzf.live_grep_native({
git_icons = false,
rg_opts = "--hidden --column --line-number --no-heading --color=always --smart-case",
fzf_opts = {
['--exact'] = false, -- Disable exact matching
},
})
end
}
})
}
local keymaps = {}
keymaps.n = {}
for _, picker in ipairs(pickers) do
keymaps.n["<leader>t" .. picker.mapping] = {
cmd = picker.action
}
end
require("utils").add_keymaps(keymaps)
end
}