{ programs.nixvim = { opts.completeopt = [ "menu" "menuone" "noselect" ]; plugins = { luasnip.enable = true; lspkind = { enable = true; cmp = { enable = true; menu = { nvim_lsp = "[LSP]"; nvim_lua = "[api]"; path = "[path]"; luasnip = "[snip]"; buffer = "[buffer]"; nixpkgs_maintainers = "[nixpkgs]"; }; }; }; cmp = { enable = true; settings = { snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; mapping = { "" = "cmp.mapping.scroll_docs(-4)"; "" = "cmp.mapping.scroll_docs(4)"; "" = "cmp.mapping.complete()"; "" = "cmp.mapping.close()"; "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; "" = "cmp.mapping.confirm({ select = true })"; }; sources = [ { name = "path"; } { name = "nvim_lsp"; } { name = "luasnip"; } { name = "nixpkgs_maintainers"; } { name = "buffer"; # words from other open buffers can also be suggested option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; } ]; }; }; }; }; }