Completely change from telescope to fzf, it's way more performant
This commit is contained in:
parent
3ecc70e179
commit
fc01aa096c
2 changed files with 39 additions and 98 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue