]> git.rmz.io Git - dotfiles.git/blobdiff - nvim/lua/plugins/coding.lua
nvim/lsp: prefer compile_commands to determine root_dir
[dotfiles.git] / nvim / lua / plugins / coding.lua
index bda4a988e246cff23a775d2e20e5f98fd400ffc2..131fc4acd874948c4d19f94aeeaa5948e7c7f66b 100644 (file)
@@ -9,6 +9,7 @@ return {
         "honza/vim-snippets",
         config = function()
           require("luasnip.loaders.from_snipmate").lazy_load()
+          require("luasnip.loaders.from_lua").load({ paths = vim.fn.stdpath("config") .. "/lua/snippets" })
         end,
       },
     },
@@ -23,6 +24,14 @@ return {
   -- auto completion
   {
     "hrsh7th/nvim-cmp",
+    version = false, -- last release is way too old
+    event = "InsertEnter",
+    dependencies = {
+      "hrsh7th/cmp-nvim-lsp",
+      "hrsh7th/cmp-buffer",
+      "hrsh7th/cmp-path",
+      "saadparwaiz1/cmp_luasnip",
+    },
     ---@param opts cmp.ConfigSchema
     opts = function(_, opts)
       local has_words_before = function()
@@ -51,7 +60,7 @@ return {
         completeopt = "menu,menuone,noselect",
       })
       -- TODO: review if I want to keep any of LazyVim's mappings
-      opts.mapping = cmp.mapping.preset.insert({
+      opts.mapping = {
         -- lazyvims
         ["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
         ["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
@@ -80,7 +89,7 @@ return {
             fallback()
           end
         end, { "i", "s" }),
-      })
+      }
     end,
   },