mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 17:58:38 +02:00
plugins/blink-cmp: update configuration
This commit is contained in:
parent
898246c943
commit
77b495801c
2 changed files with 160 additions and 60 deletions
|
@ -18,30 +18,64 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
'';
|
||||
|
||||
settingsOptions = {
|
||||
keymap =
|
||||
defaultNullOpts.mkNullableWithRaw (with types; either (attrsOf anything) (enum [ false ]))
|
||||
{
|
||||
show = "<C-space>";
|
||||
hide = "<C-e>";
|
||||
accept = "<Tab>";
|
||||
select_prev = [
|
||||
"<Up>"
|
||||
"<C-p>"
|
||||
];
|
||||
select_next = [
|
||||
"<Down>"
|
||||
"<C-n>"
|
||||
];
|
||||
show_documentation = "<C-space>";
|
||||
hide_documentation = "<C-space>";
|
||||
scroll_documentation_up = "<C-b>";
|
||||
scroll_documentation_down = "<C-f>";
|
||||
snippet_forward = "<Tab>";
|
||||
snippet_backward = "<S-Tab>";
|
||||
}
|
||||
''
|
||||
Customize the keymaps for blink.
|
||||
'';
|
||||
keymap = defaultNullOpts.mkNullableWithRaw' {
|
||||
type = with types; either (attrsOf anything) (enum [ false ]);
|
||||
pluginDefault = {
|
||||
preset = "default";
|
||||
};
|
||||
example = {
|
||||
"<C-space>" = [
|
||||
"show"
|
||||
"show_documentation"
|
||||
"hide_documentation"
|
||||
];
|
||||
"<C-e>" = [ "hide" ];
|
||||
"<C-y>" = [ "select_and_accept" ];
|
||||
|
||||
"<Up>" = [
|
||||
"select_prev"
|
||||
"fallback"
|
||||
];
|
||||
"<Down>" = [
|
||||
"select_next"
|
||||
"fallback"
|
||||
];
|
||||
"<C-p>" = [
|
||||
"select_prev"
|
||||
"fallback"
|
||||
];
|
||||
"<C-n>" = [
|
||||
"select_next"
|
||||
"fallback"
|
||||
];
|
||||
|
||||
"<C-b>" = [
|
||||
"scroll_documentation_up"
|
||||
"fallback"
|
||||
];
|
||||
"<C-f>" = [
|
||||
"scroll_documentation_down"
|
||||
"fallback"
|
||||
];
|
||||
|
||||
"<Tab>" = [
|
||||
"snippet_forward"
|
||||
"fallback"
|
||||
];
|
||||
"<S-Tab>" = [
|
||||
"snippet_backward"
|
||||
"fallback"
|
||||
];
|
||||
|
||||
};
|
||||
description = ''
|
||||
The keymap can be:
|
||||
- A preset (`'default'` | `'super-tab'` | `'enter'`)
|
||||
- A table of `keys => command[]` (optionally with a "preset" key to merge with a preset)
|
||||
When specifying 'preset' in the keymap table, the custom key mappings are merged with the preset,
|
||||
and any conflicting keys will overwrite the preset mappings.
|
||||
'';
|
||||
};
|
||||
|
||||
highlight = {
|
||||
use_nvim_cmp_as_default = defaultNullOpts.mkBool false ''
|
||||
|
@ -61,16 +95,18 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
'';
|
||||
};
|
||||
|
||||
documentation = {
|
||||
auto_show = defaultNullOpts.mkBool false ''
|
||||
Enables automatically showing documentation when typing.
|
||||
'';
|
||||
auto_show_delay_ms = defaultNullOpts.mkUnsignedInt 500 ''
|
||||
Delay, in milliseconds, after which documentation is shown.
|
||||
'';
|
||||
update_delay_ms = defaultNullOpts.mkUnsignedInt 50 ''
|
||||
Delay, in milliseconds, after which documentation is updated.
|
||||
'';
|
||||
windows = {
|
||||
documentation = {
|
||||
auto_show = defaultNullOpts.mkBool false ''
|
||||
Enables automatically showing documentation when typing.
|
||||
'';
|
||||
auto_show_delay_ms = defaultNullOpts.mkUnsignedInt 500 ''
|
||||
Delay, in milliseconds, after which documentation is shown.
|
||||
'';
|
||||
update_delay_ms = defaultNullOpts.mkUnsignedInt 50 ''
|
||||
Delay, in milliseconds, after which documentation is updated.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
nerd_font_variant =
|
||||
|
@ -102,17 +138,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
|
||||
settingsExample = {
|
||||
keymap = {
|
||||
show = "<C-space>";
|
||||
hide = "<C-e>";
|
||||
accept = "<C-y>";
|
||||
select_prev = "<C-p>";
|
||||
select_next = "<C-n>";
|
||||
show_documentation = "<C-space>";
|
||||
hide_documentation = "<C-space>";
|
||||
scroll_documentation_up = "<C-b>";
|
||||
scroll_documentation_down = "<C-f>";
|
||||
snippet_forward = "<Tab>";
|
||||
snippet_backward = "<S-Tab>";
|
||||
preset = "default";
|
||||
};
|
||||
highlight = {
|
||||
use_nvim_cmp_as_default = true;
|
||||
|
@ -131,4 +157,10 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
warnings = lib.optional (cfg.settings ? documentation) ''
|
||||
Nixvim(plugins.blink): `settings.documentation` does not correspond to a known setting, use `settings.windows.documentation` instead.
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,26 +10,18 @@
|
|||
enable = true;
|
||||
settings = {
|
||||
keymap = {
|
||||
show = "<C-space>";
|
||||
hide = "<C-e>";
|
||||
accept = "<Tab>";
|
||||
select_prev = "<C-p>";
|
||||
select_next = "<C-n>";
|
||||
show_documentation = "<C-space>";
|
||||
hide_documentation = "<C-space>";
|
||||
scroll_documentation_up = "<C-b>";
|
||||
scroll_documentation_down = "<C-f>";
|
||||
snippet_forward = "<Tab>";
|
||||
snippet_backward = "<S-Tab>";
|
||||
preset = "default";
|
||||
};
|
||||
highlight = {
|
||||
use_nvim_cmp_as_default = false;
|
||||
};
|
||||
nerd_font_variant = "normal";
|
||||
documentation = {
|
||||
auto_show = false;
|
||||
auto_show_delay_ms = 500;
|
||||
update_delay_ms = 50;
|
||||
windows = {
|
||||
documentation = {
|
||||
auto_show = false;
|
||||
auto_show_delay_ms = 500;
|
||||
update_delay_ms = 50;
|
||||
};
|
||||
};
|
||||
accept = {
|
||||
auto_brackets = {
|
||||
|
@ -63,4 +55,80 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins.blink-cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
fuzzy = {
|
||||
prebuilt_binaries = {
|
||||
download = false;
|
||||
};
|
||||
};
|
||||
keymap = {
|
||||
"<C-space>" = [
|
||||
"show"
|
||||
"show_documentation"
|
||||
"hide_documentation"
|
||||
];
|
||||
"<C-e>" = [ "hide" ];
|
||||
"<C-y>" = [ "select_and_accept" ];
|
||||
|
||||
"<Up>" = [
|
||||
"select_prev"
|
||||
"fallback"
|
||||
];
|
||||
"<Down>" = [
|
||||
"select_next"
|
||||
"fallback"
|
||||
];
|
||||
"<C-p>" = [
|
||||
"select_prev"
|
||||
"fallback"
|
||||
];
|
||||
"<C-n>" = [
|
||||
"select_next"
|
||||
"fallback"
|
||||
];
|
||||
|
||||
"<C-b>" = [
|
||||
"scroll_documentation_up"
|
||||
"fallback"
|
||||
];
|
||||
"<C-f>" = [
|
||||
"scroll_documentation_down"
|
||||
"fallback"
|
||||
];
|
||||
|
||||
"<Tab>" = [
|
||||
"snippet_forward"
|
||||
"fallback"
|
||||
];
|
||||
"<S-Tab>" = [
|
||||
"snippet_backward"
|
||||
"fallback"
|
||||
];
|
||||
};
|
||||
highlight = {
|
||||
use_nvim_cmp_as_default = true;
|
||||
};
|
||||
windows = {
|
||||
documentation = {
|
||||
auto_show = true;
|
||||
};
|
||||
};
|
||||
accept = {
|
||||
auto_brackets = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
trigger = {
|
||||
signature_help = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue