From 0d3e42be3fd32062407776bbe58dff30740ddb16 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:43:47 -0500 Subject: [PATCH] fix: neovim nvim-cmp not found in new update --- modules/common/neovim/config/completion.nix | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/common/neovim/config/completion.nix b/modules/common/neovim/config/completion.nix index 0041f3f..a9a52f3 100644 --- a/modules/common/neovim/config/completion.nix +++ b/modules/common/neovim/config/completion.nix @@ -2,6 +2,7 @@ { plugins = [ + pkgs.vimPlugins.nvim-cmp pkgs.vimPlugins.cmp-nvim-lsp pkgs.vimPlugins.cmp-buffer pkgs.vimPlugins.cmp-path @@ -26,15 +27,21 @@ # Basic completion keybinds mapping = { - "['']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })"; - "['']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })"; - "['']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select }, { 'i', 'c' })"; - "['']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select }, { 'i', 'c' })"; + "['']" = + dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })"; + "['']" = + dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })"; + "['']" = + dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select }, { 'i', 'c' })"; + "['']" = + dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select }, { 'i', 'c' })"; "['']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)"; "['']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)"; "['']" = dsl.rawLua "require('cmp').mapping.abort()"; - "['']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Insert, select = true, }, { 'i', 'c' })"; - "['']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, }, { 'i', 'c' })"; + "['']" = + dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Insert, select = true, }, { 'i', 'c' })"; + "['']" = + dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, }, { 'i', 'c' })"; "['']" = dsl.rawLua '' function(_) cmp.mapping({ @@ -128,7 +135,7 @@ }; }; - lua = '' + lua' = '' -- Use buffer source for `/` require('cmp').setup.cmdline("/", { mapping = {