{...}: { # Autocompletion plugin plugins.cmp = { enable = true; autoEnableSources = true; # Options provided to the require('cmp').setup function. settings = { # The sources to use sources = [ # Language Server Protocol { name = "nvim_lsp"; } # Buffer Words { name = "buffer"; } # Filesystem paths { name = "path"; } # Markdown { name = "render_markdown"; } # VimTex { name = "vimtex"; } # Neorg { name = "neorg"; } ]; # Key mappings for the completion menu. mapping = { # Confirm selection "" = /* lua */ '' cmp.mapping.confirm({ select = true }) ''; # Select the next item in the menu "" = /* lua */ '' cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'}) ''; # Select the prev item in the menu "" = /* lua */ '' cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'}) ''; # Exit the completion menu "" = /* lua */ '' cmp.mapping.close() ''; }; }; }; }