added lua configs

This commit is contained in:
2025-06-27 16:31:58 +03:00
parent 84c5c9b232
commit 2a44183c66
11 changed files with 408 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
local conf = require('telescope.config').values
local themes = require('telescope.themes')
-- helper function to use telescope on harpoon list.
-- change get_ivy to other themes if wanted
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
local opts = themes.get_ivy({
promt_title = "Working List"
})
require("telescope.pickers").new(opts, {
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer(opts),
sorter = conf.generic_sorter(opts),
}):find()
end
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim"
},
config = function()
local harpoon = require('harpoon')
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<leader>fl", function() toggle_telescope(harpoon:list()) end,
{ desc = "Open harpoon window" })
vim.keymap.set("n", "<C-p>", function() harpoon:list():prev() end)
vim.keymap.set("n", "<C-n>", function() harpoon:list():next() end)
end
}