Added Harpoon and changed some confgis
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" },
|
"friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" },
|
||||||
|
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "758bb5de98b805acc5eeed8cdc8ac7f0bc4b0b86" },
|
"lazy.nvim": { "branch": "main", "commit": "758bb5de98b805acc5eeed8cdc8ac7f0bc4b0b86" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" },
|
||||||
|
|||||||
44
lua/plugins/harpoon.lua
Normal file
44
lua/plugins/harpoon.lua
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
return {
|
||||||
|
"ThePrimeagen/harpoon",
|
||||||
|
branch = "harpoon2",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
|
||||||
|
-- Setup Harpoon with Telescope
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
-- Setup Harpoon keybinds
|
||||||
|
harpoon:setup()
|
||||||
|
vim.keymap.set("n", "<leader>a", function()
|
||||||
|
harpoon:list():add()
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<C-e>", function()
|
||||||
|
toggle_telescope(harpoon:list())
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<A-p>", function()
|
||||||
|
harpoon:list():prev()
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<A-n>", function()
|
||||||
|
harpoon:list():next()
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,36 +1,40 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
"gopls"
|
"gopls",
|
||||||
}
|
"rust_analyzer",
|
||||||
})
|
},
|
||||||
end
|
})
|
||||||
},
|
end,
|
||||||
{
|
},
|
||||||
"neovim/nvim-lspconfig",
|
{
|
||||||
config = function()
|
"neovim/nvim-lspconfig",
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
config = function()
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
lspconfig.lua_ls.setup({
|
lspconfig.lua_ls.setup({
|
||||||
capabilities = capabilities
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
lspconfig.gopls.setup({
|
lspconfig.gopls.setup({
|
||||||
capabilities = capabilities
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
|
lspconfig.rust_analyzer.setup({
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
capabilities = capabilities,
|
||||||
vim.keymap.set({'n', 'v'}, '<leader>ca', vim.lsp.buf.code_action, {})
|
})
|
||||||
end
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
||||||
}
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user