2023-10-27 11:29:23 +00:00
|
|
|
return {
|
2023-10-28 04:37:04 +00:00
|
|
|
-- Need a telescope to see your johnsons.
|
2023-10-27 11:29:23 +00:00
|
|
|
{
|
|
|
|
"nvim-telescope/telescope.nvim",
|
|
|
|
depedencies = {
|
2023-10-28 04:37:04 +00:00
|
|
|
"nvim-lua/plenary.nvim",
|
|
|
|
"nvim-telescope/telescope-project.nvim",
|
2023-10-27 11:29:23 +00:00
|
|
|
},
|
2023-10-28 04:37:04 +00:00
|
|
|
module = true,
|
2023-10-27 11:29:23 +00:00
|
|
|
config = function()
|
|
|
|
local telescope = require("telescope")
|
2023-10-28 04:39:05 +00:00
|
|
|
telescope.setup({
|
2025-01-24 05:38:27 +00:00
|
|
|
defaults = {
|
|
|
|
layout_config = {
|
|
|
|
height = 0.95,
|
|
|
|
width = 0.9,
|
|
|
|
anchor_padding = 0,
|
|
|
|
},
|
|
|
|
},
|
2023-10-27 11:29:23 +00:00
|
|
|
extensions = {
|
|
|
|
project = {
|
|
|
|
base_dirs = {
|
|
|
|
{ "~/library/projects/software", max_depth = 2 },
|
|
|
|
{ "~/library/projects/packages" },
|
|
|
|
{ "~/library/writings" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2023-10-28 04:39:05 +00:00
|
|
|
})
|
2023-10-27 11:29:23 +00:00
|
|
|
|
|
|
|
local builtins = require("telescope.builtin")
|
2023-10-28 04:37:04 +00:00
|
|
|
local opts = { noremap = true }
|
2023-10-27 11:29:23 +00:00
|
|
|
local get_builtin = function(fun, ...)
|
|
|
|
local fargs = arg
|
|
|
|
return function()
|
|
|
|
builtins[fun](fargs)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2025-01-24 05:38:27 +00:00
|
|
|
vim.keymap.set("n", "<leader>ff", get_builtin("find_files", { hidden = true, preview = false }), {
|
|
|
|
noremap = true,
|
|
|
|
desc = "Find files in project",
|
|
|
|
})
|
2023-10-28 04:39:05 +00:00
|
|
|
vim.keymap.set("n", "<leader>fF", function()
|
|
|
|
builtins.find_files({
|
|
|
|
cwd = require("telescope.utils").buffer_dir(),
|
|
|
|
hidden = true,
|
2025-01-24 05:38:27 +00:00
|
|
|
preview = false,
|
2023-10-28 04:39:05 +00:00
|
|
|
})
|
2025-01-24 05:38:27 +00:00
|
|
|
end, { noremap = true, desc = "Find files in current directory" })
|
2023-10-27 11:29:23 +00:00
|
|
|
|
2025-01-24 05:38:27 +00:00
|
|
|
vim.keymap.set("n", "<leader>fg", get_builtin("grep_string"), { noremap = true, desc = "Grep for string in cursor" })
|
|
|
|
vim.keymap.set("n", "<leader>fG", get_builtin("live_grep"), { noremap = true, desc = "Grep for string in project" })
|
|
|
|
vim.keymap.set("n", "<leader>fb", get_builtin("buffers"), { noremap = true, desc = "Search currently opened buffers" })
|
|
|
|
vim.keymap.set("n", "<leader>fh", get_builtin("help_tags"), { noremap = true, desc = "Search help pages" })
|
|
|
|
vim.keymap.set("n", "<leader>ft", get_builtin("treesitter"), { noremap = true, desc = "Search treesitter objects" })
|
|
|
|
vim.keymap.set("n", "<leader>fM", get_builtin("man_pages"), { noremap = true, desc = "Search manpages" })
|
2023-10-28 04:37:04 +00:00
|
|
|
|
2025-01-24 05:38:27 +00:00
|
|
|
vim.keymap.set("n", "<leader>fA", get_builtin("resume"), { noremap = true, desc = "Return last search" })
|
2023-10-27 11:29:23 +00:00
|
|
|
|
|
|
|
-- Ekeymap.set
|
2023-10-28 04:39:05 +00:00
|
|
|
vim.keymap.set("n", "<leader>fp", [[<cmd>lua require("telescope").extensions.project.project({})<cr>]], opts)
|
2023-10-27 11:29:23 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- Marks in ~~steroids~~ coconut oil
|
|
|
|
{
|
|
|
|
"ThePrimeagen/harpoon",
|
|
|
|
config = function()
|
2025-01-24 05:38:27 +00:00
|
|
|
vim.keymap.set("n", "<leader>fm", "<cmd>lua require('harpoon.mark').add_file()<cr>", { desc = "Add mark to file" })
|
2023-10-27 11:29:23 +00:00
|
|
|
|
|
|
|
local has_telescope, telescope = pcall("telescope")
|
|
|
|
if has_telescope then
|
|
|
|
vim.keymap.set("n", "<leader>fM", "<cmd>lua require('telescope').extensions.harpoon.harpoon({})<cr>", {})
|
|
|
|
require("telescope").load_extension("harpoon")
|
|
|
|
end
|
|
|
|
end,
|
2023-10-28 04:37:04 +00:00
|
|
|
dependencies = { "nvim-lua/plenary.nvim" },
|
2023-10-28 04:39:05 +00:00
|
|
|
},
|
2023-10-27 11:29:23 +00:00
|
|
|
}
|