summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkkard2 <[email protected]>2024-04-05 10:39:41 +0200
committerkkard2 <[email protected]>2024-04-05 10:39:41 +0200
commit03e63fd28f54fbbd750b7bd8f8de67ebddf1081c (patch)
treedd92531c73a4a41b68a9f5190af4fe62d09731e5
parentd810f83140724775b355f5301de8db3371ea6668 (diff)
merge confilict incoming
-rw-r--r--nvim/init.lua33
1 files changed, 30 insertions, 3 deletions
diff --git a/nvim/init.lua b/nvim/init.lua
index 389e6cd..961d484 100644
--- a/nvim/init.lua
+++ b/nvim/init.lua
@@ -245,18 +245,45 @@ require("lazy").setup({
{ "hrsh7th/cmp-nvim-lsp" },
{
"hrsh7th/nvim-cmp",
- dependencies = { "quangnguyen30192/cmp-nvim-tags" },
+ dependencies = { "quangnguyen30192/cmp-nvim-tags", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip" },
config = function()
- require("cmp").setup({
+ local cmp = require("cmp")
+ local luasnip = require("luasnip")
+ cmp.setup({
+ snippet = {
+ expand = function(args)
+ luasnip.lsp_expand(args.body)
+ end,
+ },
sources = {
{ name = "nvim_lsp" },
+ { name = "luasnip" },
{ name = "tags" },
},
+ mapping = cmp.mapping.preset.insert({
+ ["<C-n>"] = cmp.mapping.select_next_item(),
+ ["<C-p>"] = cmp.mapping.select_prev_item(),
+ ["<C-y>"] = cmp.mapping.confirm({ select = true }),
+ }),
+ ["<C-l>"] = cmp.mapping(function()
+ if luasnip.expand_or_locally_jumpable() then
+ luasnip.expand_or_jump()
+ end
+ end, { "i", "s" }),
+ ["<C-h>"] = cmp.mapping(function()
+ if luasnip.locally_jumpable(-1) then
+ luasnip.jump(-1)
+ end
+ end, { "i", "s" }),
})
end
},
{
+ "L3MON4D3/LuaSnip",
+ version = "v2.*",
+ },
+ {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
@@ -277,5 +304,5 @@ require("lazy").setup({
vim.keymap.set("n", "<leader>8", function() harpoon:list():select(8) end)
vim.keymap.set("n", "<leader>9", function() harpoon:list():select(9) end)
end,
- }
+ },
})