Open
Description
Field | Description |
---|---|
Plugin | cmp |
Nixpkgs | unstable |
Home Manager | unstable |
- I have read the FAQ and my bug is not listed there.
Description
The option plugins.cmp.cmdline.<name>.mapping
doesnt seem to work as intended. It works if you use a preset, but specifying the keymaps manually doesnt produce the output expected by cmp
.
cmp wants them to look like this:
{
["<C-j>"] = {
c = cmp.mapping.select_next_item()
},
["<C-k>"] = {
c = cmp.mapping.select_prev_item()
},
["<esc>"] = {
c = cmp.mapping.abort(),
},
["<CR>"] = {
c = cmp.mapping.confirm({ select = false }),
},
}
while nixvim generates this:
{
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-k>"] = cmp.mapping.select_prev_item(),
["<esc>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
}
Quick and dirty workaround ist to just use mkRaw
Minimal, Reproducible Example (MRE)
programs.nixvim = {
plugins.cmp = {
enable = true;
cmdline.":" = {
sources = [ { name = "cmdline"; } ];
mapping = {
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_next_item()";
"<esc>" = "cmp.mapping.select_next_item()";
"<CR>" = "cmp.mapping.select_next_item()";
};
};
};
};