diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua index 860079b..bfe602b 100644 --- a/after/plugin/harpoon.lua +++ b/after/plugin/harpoon.lua @@ -1,13 +1,44 @@ local harpoon = require("harpoon") -- REQUIRED -harpoon:setup() +harpoon:setup({}) -- REQUIRED +-- +-- basic telescope configuration +local conf = require("telescope.config").values +local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end -vim.keymap.set("n", "a", function() harpoon:list():append() end) -vim.keymap.set("n", "h", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + require("telescope.pickers").new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }):find() +end + +vim.keymap.set("n", "H", function() toggle_telescope(harpoon:list()) end, + { desc = "Open harpoon in telescope" }) + + +vim.keymap.set("n", "a", function() harpoon:list():add() end, + { desc = "Harpoon: Add current buffer" }) +vim.keymap.set("n", "hh", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, + { desc = "Harpoon: Toggle quick menu" }) vim.keymap.set("n", "", function() harpoon:list():select(1) end) vim.keymap.set("n", "", function() harpoon:list():select(2) end) vim.keymap.set("n", "", function() harpoon:list():select(3) end) vim.keymap.set("n", "", function() harpoon:list():select(4) end) + +-- Toggle previous & next buffers stored within Harpoon list +vim.keymap.set("n", "hp", function() harpoon:list():prev() end, + { desc = "Harpoon: Previous buffer" }) +vim.keymap.set("n", "hn", function() harpoon:list():next() end, + { desc = "Harpoon: Next buffer" }) + diff --git a/lua/sevi-kun/plugins.lua b/lua/sevi-kun/plugins.lua index ad9b633..77322dd 100644 --- a/lua/sevi-kun/plugins.lua +++ b/lua/sevi-kun/plugins.lua @@ -17,7 +17,8 @@ return { } }, - { "nvim-telescope/telescope.nvim", branch = "0.1.x", + { "nvim-telescope/telescope.nvim", + version = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } }, @@ -35,16 +36,20 @@ return { } }, - { "stevearc/oil.nvim" }, + { "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" } + }, { "kylechui/nvim-surround", version = "*", + event = "VeryLazy", config = function() require("nvim-surround").setup() end }, { "numToStr/Comment.nvim", + lazy = false, config = function() require("Comment").setup() end @@ -91,7 +96,10 @@ return { -- lsp - { "github/copilot.vim" }, + { + 'Exafunction/codeium.vim', + event = 'BufEnter' + }, {"williamboman/mason.nvim", lazy = false,