DEVELOPMENT ENVIRONMENT

~liljamo/nvim-flake

cbfd082da31f5d5a2548b27c6fe7e0abcb251abd — Jonni Liljamo 3 months ago 2090686
feat(cmp): init
2 files changed, 42 insertions(+), 0 deletions(-)

A config/plugins/cmp.nix
M config/plugins/default.nix
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