1
0

Split harpoon and telescope configs

This commit is contained in:
Patrick Auernig 2024-01-31 21:58:46 +01:00
parent 07322e2636
commit 0558e8d786
2 changed files with 32 additions and 24 deletions

View File

@ -0,0 +1,27 @@
local spec = {
"ThePrimeagen/harpoon",
}
spec.dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
}
spec.keys = {
{ "<Leader>fh", "<cmd>Telescope harpoon marks<CR>" },
}
spec.config = function()
local telescope = require("telescope")
telescope.load_extension("harpoon")
local harpoon_mark = require("harpoon.mark")
local harpoon_ui = require("harpoon.ui")
vim.keymap.set("n", "<Leader>am", harpoon_mark.add_file)
vim.keymap.set("n", "<Leader>gn", harpoon_ui.nav_next)
vim.keymap.set("n", "<Leader>gp", harpoon_ui.nav_prev)
end
return spec

View File

@ -6,14 +6,12 @@ local spec = {
spec.dependencies = { spec.dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"ThePrimeagen/harpoon",
} }
spec.keys = { spec.keys = {
"<Leader>ff", { "<Leader>ff", "<cmd>Telescope find_files<CR>" },
"<Leader>fb", { "<Leader>fb", "<cmd>Telescope buffers<CR>" },
"<Leader>fg", { "<Leader>fg", "<cmd>Telescope live_grep<CR>" },
"<Leader>fh",
} }
spec.config = function() spec.config = function()
@ -45,9 +43,7 @@ spec.config = function()
end end
end end
telescope.load_extension("harpoon") telescope.setup({
telescope.setup {
defaults = { defaults = {
initial_mode = "insert" initial_mode = "insert"
}, },
@ -71,22 +67,7 @@ spec.config = function()
} }
} }
} }
} })
local telescope_builtin = require("telescope.builtin")
vim.keymap.set("n", "<Leader>ff", telescope_builtin.find_files)
vim.keymap.set("n", "<Leader>fb", telescope_builtin.buffers)
vim.keymap.set("n", "<Leader>fg", telescope_builtin.live_grep)
local telescope_ext = require("telescope").extensions
local harpoon_mark = require("harpoon.mark")
local harpoon_ui = require("harpoon.ui")
vim.keymap.set("n", "<Leader>fh", telescope_ext.harpoon.marks)
vim.keymap.set("n", "<Leader>am", harpoon_mark.add_file)
vim.keymap.set("n", "<Leader>gn", harpoon_ui.nav_next)
vim.keymap.set("n", "<Leader>gp", harpoon_ui.nav_prev)
end end
return spec return spec