From cbfd082da31f5d5a2548b27c6fe7e0abcb251abd Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Sun, 2 Jun 2024 18:26:29 +0300 Subject: [PATCH] feat(cmp): init --- config/plugins/cmp.nix | 41 ++++++++++++++++++++++++++++++++++++++ config/plugins/default.nix | 1 + 2 files changed, 42 insertions(+) create mode 100644 config/plugins/cmp.nix diff --git a/config/plugins/cmp.nix b/config/plugins/cmp.nix new file mode 100644 index 0000000..6542d3e --- /dev/null +++ b/config/plugins/cmp.nix @@ -0,0 +1,41 @@ +{ + opts = { + completeopt = [ "menu" "menuone" "noselect"]; + }; + extraConfigLua = '' + vim.opt.shortmess:append "c" + ''; + plugins = { + cmp = { + enable = true; + settings = { + sources = [ + { name = "nvim_lsp"; } + { name = "async_path"; } + { name = "buffer"; } + ]; + mapping = { + "" = "cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }"; + "" = "cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }"; + "" = '' + cmp.mapping( + cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Insert, + select = true, + }, + { "i", "c" } + ) + ''; + }; + }; + }; + cmp-async-path.enable = true; + cmp-buffer.enable = true; + cmp-nvim-lsp.enable = true; + + lspkind = { + enable = true; + cmp.enable = true; + }; + }; +} diff --git a/config/plugins/default.nix b/config/plugins/default.nix index 176b583..53d891f 100644 --- a/config/plugins/default.nix +++ b/config/plugins/default.nix @@ -1,5 +1,6 @@ {pkgs, ...}: { imports = [ + ./cmp.nix ./oil.nix ./telescope.nix ./treesitter.nix -- 2.44.1