# Completion plugin for auto-completion { config, lib, ... }: let cfg = config.development.nixvim; in { config.programs.nixvim.plugins.cmp = lib.mkIf cfg.enable { enable = true; autoEnableSources = true; settings = { snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; mapping = { "" = "cmp.mapping.complete()"; "" = "cmp.mapping.confirm({ select = true })"; "" = "cmp.mapping.select_next_item()"; "" = "cmp.mapping.select_prev_item()"; "" = "cmp.mapping.select_next_item()"; "" = "cmp.mapping.select_prev_item()"; "" = "cmp.mapping.scroll_docs(-4)"; # scroll docs up "" = "cmp.mapping.scroll_docs(4)"; # scroll docs down "" = builtins.readFile ./escape.lua; }; sources = [ { name = "nvim_lsp"; } { name = "path"; } { name = "buffer"; } ]; }; }; }