{ plugins.cmp = { enable = true; settings = { completion = { keyword_length = 2; }; mapping = { "" = "cmp.mapping.select_next_item()"; "" = "cmp.mapping.select_prev_item()"; "" = "cmp.mapping.scroll_docs(-4)"; "" = "cmp.mapping.scroll_docs(4)"; "" = "cmp.mapping.complete()"; "" = "cmp.mapping.abort()"; # Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. "" = "cmp.mapping.confirm({ select = true })"; }; snippet.expand = '' function(args) require('luasnip').lsp_expand(args.body) end ''; sources = [ { name = "nvim_lsp"; } { name = "buffer"; } { name = "cmdline"; } { name = "cmp-clippy"; } { name = "luasnip"; } { name = "path"; } ]; }; }; plugins.luasnip.enable = true; }