nixvim/plugins/blink-cmp.nix
Lander Van den Bulcke 61feed4086
refactor: complete overhaul
Complete overhaul of repo structure based on nvix.

See https://github.com/niksingh710/nvix

Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
2025-10-19 18:25:15 +02:00

95 lines
2 KiB
Nix

{ lib, ... }:
let
inherit (lib.nixvim) mkRaw;
in
{
plugins = {
blink-cmp = {
enable = true;
settings = {
completion.menu.border = "rounded";
signature = {
enabled = true;
trigger = {
enabled = true;
show_on_keyword = true;
show_on_insert = true;
};
window = {
show_documentation = true;
};
};
keymap = {
"<C-j>" = [
"select_next"
"fallback"
];
"<C-k>" = [
"select_prev"
"fallback"
];
"<c-l>" = [
"snippet_forward"
"fallback"
];
"<c-h>" = [
"snippet_backward"
"fallback"
];
"<c-u>" = [
"scroll_documentation_up"
"fallback"
];
"<c-d>" = [
"scroll_documentation_down"
"fallback"
];
"<C-space>" = [
(
# lua
mkRaw ''
function(cmp)
local ok,_ = pcall(require, "copilot")
if ok then
vim.g.copilot_no_tab_map = true
vim.g.copilot_assume_mapped = true
vim.g.copilot_tab_fallback = ""
local suggestion = require("copilot.suggestion")
if suggestion.is_visible() then
suggestion.accept()
else
if cmp.snippet_active() then
return cmp.select_and_accept()
else
return cmp.accept()
end
end
end
end
''
)
];
};
};
};
schemastore = {
enable = true;
json = {
enable = true;
};
yaml = {
enable = true;
};
};
};
}