2023-11-25 14:37:36 +02:00
|
|
|
--- @type LazyPluginSpec
|
2023-11-18 02:27:14 +02:00
|
|
|
return {
|
|
|
|
"nvim-telescope/telescope.nvim",
|
2023-11-25 14:58:52 +02:00
|
|
|
lazy = false,
|
2023-11-18 02:27:14 +02:00
|
|
|
dependencies = {
|
|
|
|
-- Internal dependency for telescope
|
|
|
|
"nvim-lua/plenary.nvim",
|
2022-08-24 00:38:10 +03:00
|
|
|
|
2023-11-18 02:27:14 +02:00
|
|
|
-- Use fzf for fuzzy finder
|
|
|
|
{
|
|
|
|
"nvim-telescope/telescope-fzf-native.nvim",
|
|
|
|
build = "make",
|
|
|
|
},
|
|
|
|
|
|
|
|
-- Replace vim built in select with telescope
|
|
|
|
"nvim-telescope/telescope-ui-select.nvim",
|
|
|
|
|
|
|
|
-- cd plugin for telescope
|
|
|
|
"zane-/cder.nvim",
|
2023-11-25 15:58:35 +02:00
|
|
|
|
|
|
|
-- Switch to a project
|
|
|
|
{
|
|
|
|
"ahmedkhalf/project.nvim",
|
|
|
|
main = "project_nvim",
|
2023-11-28 15:28:20 +02:00
|
|
|
opts = {
|
|
|
|
patterns = { ".git" },
|
|
|
|
},
|
2023-11-25 15:58:35 +02:00
|
|
|
},
|
2023-11-18 02:27:14 +02:00
|
|
|
},
|
|
|
|
opts = {
|
2023-11-20 22:08:46 +02:00
|
|
|
-- Set layout to vertical
|
2023-11-18 23:23:39 +02:00
|
|
|
defaults = {
|
|
|
|
layout_strategy = "vertical",
|
|
|
|
layout_defaults = {
|
|
|
|
vertical = {
|
|
|
|
preview_height = 0.5,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2023-09-18 16:48:04 +03:00
|
|
|
pickers = {
|
|
|
|
find_files = { find_command = { "fd", "-Ht", "f" } },
|
|
|
|
lsp_references = { show_line = false },
|
2023-11-17 08:01:52 +02:00
|
|
|
live_grep = {
|
2023-11-20 22:08:46 +02:00
|
|
|
additional_args = function()
|
2023-11-17 08:01:52 +02:00
|
|
|
return { "--hidden" }
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
extensions = {
|
|
|
|
cder = {
|
|
|
|
previewer_command = "eza "
|
|
|
|
.. "-a "
|
|
|
|
.. "--color=always "
|
|
|
|
.. "-T "
|
|
|
|
.. "--level=3 "
|
|
|
|
.. "--icons "
|
|
|
|
.. "--git-ignore "
|
|
|
|
.. "--long "
|
|
|
|
.. "--no-permissions "
|
|
|
|
.. "--no-user "
|
|
|
|
.. "--no-filesize "
|
|
|
|
.. "--git "
|
|
|
|
.. "--ignore-glob=.git",
|
|
|
|
dir_command = { "fd", "-Ht", "d", ".", os.getenv("HOME") },
|
|
|
|
},
|
2023-09-18 16:48:04 +03:00
|
|
|
},
|
2023-11-18 02:27:14 +02:00
|
|
|
},
|
2023-11-25 14:13:26 +02:00
|
|
|
keys = {
|
|
|
|
{
|
|
|
|
desc = "Open Telescope",
|
|
|
|
"<C-s>",
|
|
|
|
"<cmd>Telescope<cr>",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
desc = "Change directories",
|
|
|
|
"cd",
|
|
|
|
"<cmd>Telescope cder<cr>",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
desc = "Find files",
|
|
|
|
"<C-f>",
|
|
|
|
"<cmd>Telescope find_files<cr>",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
desc = "Grep files",
|
|
|
|
"<C-g>",
|
|
|
|
"<cmd>Telescope live_grep<cr>",
|
|
|
|
},
|
2023-11-25 15:58:35 +02:00
|
|
|
{
|
|
|
|
desc = "Change to a project",
|
|
|
|
"<C-p>",
|
|
|
|
"<cmd>Telescope projects<cr>",
|
|
|
|
},
|
2023-11-25 14:13:26 +02:00
|
|
|
},
|
2023-11-18 02:54:35 +02:00
|
|
|
config = function(_, opts)
|
2023-11-18 02:27:14 +02:00
|
|
|
local telescope = require("telescope")
|
2023-11-18 02:54:35 +02:00
|
|
|
telescope.setup(opts)
|
2022-08-24 00:38:10 +03:00
|
|
|
|
2023-11-25 14:13:26 +02:00
|
|
|
-- Load extensions
|
2023-11-18 02:27:14 +02:00
|
|
|
telescope.load_extension("fzf")
|
|
|
|
telescope.load_extension("ui-select")
|
|
|
|
telescope.load_extension("cder")
|
2023-11-25 15:58:35 +02:00
|
|
|
telescope.load_extension("projects")
|
2023-11-18 02:27:14 +02:00
|
|
|
end,
|
|
|
|
}
|