2024-05-13 18:43:31 +00:00
|
|
|
return {
|
|
|
|
"nvim-telescope/telescope.nvim",
|
|
|
|
tag = "0.1.5",
|
|
|
|
dependencies = {
|
|
|
|
"nvim-lua/plenary.nvim",
|
2024-06-02 17:11:54 +00:00
|
|
|
"nvim-telescope/telescope-ui-select.nvim",
|
2024-05-13 18:43:31 +00:00
|
|
|
},
|
|
|
|
config = function()
|
|
|
|
-- Setup --
|
|
|
|
require("telescope").setup({
|
|
|
|
extensions = {
|
|
|
|
["ui-select"] = {
|
|
|
|
require("telescope.themes").get_dropdown({}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
require("telescope").load_extension("ui-select")
|
|
|
|
|
|
|
|
-- Keybinding --
|
2024-06-02 17:45:00 +00:00
|
|
|
local function setTelescopeBinding(
|
|
|
|
mode,
|
|
|
|
keymap,
|
|
|
|
method,
|
|
|
|
search_global,
|
|
|
|
description
|
|
|
|
)
|
2024-05-13 18:43:31 +00:00
|
|
|
local function binding()
|
2024-06-02 17:45:00 +00:00
|
|
|
local path = search_global and "~"
|
|
|
|
or require("neo-tree.sources.manager").get_state(
|
|
|
|
"filesystem"
|
|
|
|
).path
|
2024-05-13 18:43:31 +00:00
|
|
|
method({ search_dirs = { path } })
|
|
|
|
end
|
|
|
|
vim.keymap.set(mode, keymap, binding, { desc = description })
|
|
|
|
end
|
|
|
|
|
|
|
|
local telescope = require("telescope.builtin")
|
|
|
|
|
2024-06-02 17:45:00 +00:00
|
|
|
setTelescopeBinding(
|
|
|
|
"n",
|
|
|
|
"<leader>ff",
|
|
|
|
telescope.find_files,
|
|
|
|
false,
|
|
|
|
"Find File"
|
|
|
|
)
|
|
|
|
setTelescopeBinding(
|
|
|
|
"n",
|
|
|
|
"<leader>fz",
|
|
|
|
telescope.live_grep,
|
|
|
|
false,
|
|
|
|
"Fuzzy Find"
|
|
|
|
)
|
|
|
|
setTelescopeBinding(
|
|
|
|
"n",
|
|
|
|
"<leader>gff",
|
|
|
|
telescope.find_files,
|
|
|
|
true,
|
|
|
|
"Global Find File"
|
|
|
|
)
|
|
|
|
setTelescopeBinding(
|
|
|
|
"n",
|
|
|
|
"<leader>gfz",
|
|
|
|
telescope.live_grep,
|
|
|
|
true,
|
|
|
|
"Global Fuzzy Find"
|
|
|
|
)
|
2024-06-02 17:11:54 +00:00
|
|
|
end,
|
2024-05-13 18:43:31 +00:00
|
|
|
}
|