75 lines
2.7 KiB
Lua
75 lines
2.7 KiB
Lua
return {
|
|
-- Main Telescope plugin
|
|
{
|
|
"nvim-telescope/telescope.nvim",
|
|
version = "*", -- gets latest stable release; "*" is recommended now
|
|
-- alternatively pin to a specific tag if you prefer stability:
|
|
-- tag = "0.2.1", -- check https://github.com/nvim-telescope/telescope.nvim/tags for latest
|
|
|
|
dependencies = {
|
|
"nvim-lua/plenary.nvim", -- required
|
|
|
|
-- Strongly recommended: much faster fuzzy sorting & matching
|
|
{
|
|
"nvim-telescope/telescope-fzf-native.nvim",
|
|
build = "make", -- or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release" if you prefer
|
|
},
|
|
|
|
-- Optional nice-to-haves (uncomment if you want them)
|
|
-- "nvim-tree/nvim-web-devicons", -- for nicer icons (if you don't have it elsewhere)
|
|
-- "nvim-telescope/telescope-ui-select.nvim", -- use Telescope for vim.ui.select()
|
|
-- "nvim-telescope/telescope-file-browser.nvim",
|
|
},
|
|
|
|
config = function()
|
|
local telescope = require("telescope")
|
|
|
|
telescope.setup({
|
|
defaults = {
|
|
-- Some sensible defaults — feel free to customize
|
|
layout_strategy = "horizontal", -- or "vertical", "bottom_pane", "ivy", etc.
|
|
layout_config = {
|
|
horizontal = { preview_width = 0.55 },
|
|
},
|
|
mappings = {
|
|
i = {
|
|
["<C-j>"] = "move_selection_next",
|
|
["<C-k>"] = "move_selection_previous",
|
|
},
|
|
},
|
|
-- path_display = { "truncate" }, -- nicer path shortening
|
|
},
|
|
|
|
-- You can add picker-specific configs here too
|
|
pickers = {
|
|
find_files = {
|
|
hidden = true, -- show dotfiles
|
|
},
|
|
},
|
|
|
|
extensions = {
|
|
-- If you add extensions above, configure/load them here
|
|
-- fzf = { fuzzy = true, override_generic_sorter = true, override_file_sorter = true },
|
|
-- ["ui-select"] = { require("telescope.themes").get_dropdown({}) },
|
|
},
|
|
})
|
|
|
|
-- Load fzf extension (highly recommended for speed)
|
|
pcall(telescope.load_extension, "fzf")
|
|
|
|
-- ADD KEYMAPS HERE
|
|
local builtin = require("telescope.builtin")
|
|
|
|
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" })
|
|
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Find Git files" })
|
|
vim.keymap.set("n", "<leader>ps", function()
|
|
builtin.grep_string({ search = vim.fn.input("Grep > ") });
|
|
end)
|
|
|
|
-- Optional: load other extensions if you added them
|
|
-- pcall(telescope.load_extension, "ui-select")
|
|
-- pcall(telescope.load_extension, "file_browser")
|
|
end,
|
|
},
|
|
}
|