.dotfiles/home/.config/nvim/lua/plugs/telescope.lua
Martin Larsson 77eab724c6 Fix telescope highlights and refactor the entire thing quite a bit. It
now looks as it should, and also uses the edge tool highlights. Finally,
added an edge tool border highlight group!
2024-06-30 18:06:08 +02:00

65 lines
2.2 KiB
Lua

return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-fzf-native.nvim",
},
config = function()
local dropdown = require("telescope.themes").get_dropdown({
borderchars = {
prompt = { "", "", "", "", "", "", "", "" },
results = { "", "", "", "", "", "", "", "" },
preview = { "", "", "", "", "", "", "", "" },
},
prompt_title = "",
winblend = 20
})
require("telescope").setup({
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = false,
override_file_sorter = true,
case_mode = "smart_case",
},
},
})
require("telescope").load_extension("fzf")
local builtin = require("telescope.builtin")
require("utils").add_keymaps({
n = {
["<leader>to"] = {
cmd = function()
builtin.find_files(vim.tbl_extend("force", dropdown, {
prompt_prefix = "Files> ",
previewer = false,
}))
end
},
["<leader>tf"] = {
cmd = function()
builtin.current_buffer_fuzzy_find(vim.tbl_extend("force", dropdown, {
prompt_prefix = "Find> "
}))
end
},
["<leader>ta"] = {
cmd = function()
builtin.live_grep(vim.tbl_extend("force", dropdown, {
prompt_prefix = "Grep> "
}))
end
},
["<leader>tb"] = {
cmd = function()
builtin.marks(vim.tbl_extend("force", dropdown, {
prompt_prefix = "Marks> "
}))
end
}
}
})
end,
}