A config/plugins/cmp.nix => config/plugins/cmp.nix +41 -0
@@ 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 = {
+ "<C-n>" = "cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }";
+ "<C-p>" = "cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }";
+ "<C-y>" = ''
+ 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;
+ };
+ };
+}
M config/plugins/default.nix => config/plugins/default.nix +1 -0
@@ 1,5 1,6 @@
{pkgs, ...}: {
imports = [
+ ./cmp.nix
./oil.nix
./telescope.nix
./treesitter.nix