feat(neovim): enable and configure blink-cmp plugin
All checks were successful
Flake checker / Build Nix targets (push) Successful in 9m26s

This commit is contained in:
uttarayan21
2025-10-17 00:41:34 +05:30
parent d75bc3916d
commit 787290f07a
2 changed files with 122 additions and 81 deletions

6
flake.lock generated
View File

@@ -2532,11 +2532,11 @@
"norg-meta": "norg-meta" "norg-meta": "norg-meta"
}, },
"locked": { "locked": {
"lastModified": 1760523604, "lastModified": 1760631802,
"narHash": "sha256-jI9PANPWfkAyLzMDeryPjiL7S+Y3h9YJ5qdCS2v1ozY=", "narHash": "sha256-S7Y99hLRow3m6V3bt65bKpuvwewUF4q5SD/Xm+ZU8+8=",
"owner": "nvim-neorg", "owner": "nvim-neorg",
"repo": "nixpkgs-neorg-overlay", "repo": "nixpkgs-neorg-overlay",
"rev": "a5dcae3e46a59744969eb48290db0a9253d86ac9", "rev": "e6919e67252a6ced7f97ab8a6cdd0599b94c0024",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -534,93 +534,134 @@ in {
# end # end
# ''; # '';
}; };
# blink-cmp = { blink-cmp = {
# enable = false;
# settings = {
# sources = {
# cmdline = [];
# default = ["lsp" "dictionary" "snippets" "path" "buffer"];
# providers = {
# buffer = {
# score_offset = -7;
# };
# lsp = {
# fallbacks = [];
# };
# path = {};
# dictionary = {
# module = "blink-cmp-dictionary";
# name = "Dict";
# min_keyword_length = 3;
# opts = {
# };
# };
# };
# };
# };
# };
# blink-cmp-dictionary.enable = true;
# blink-cmp-git.enable = true;
# blink-cmp-copilot.enable = true;
# blink-cmp-spell.enable = true;
# blink-compat.enable = true;
cmp = {
enable = true; enable = true;
settings = { settings = {
autoEnableSources = true;
sources = [
{name = "buffer";}
{name = "buffer";}
{name = "cmdline";}
{name = "cmp-clippy";}
{name = "cmp-cmdline-history";}
{name = "crates";}
{name = "dap";}
# {name = "dictionary";}
{name = "fish";}
{name = "git";}
{name = "luasnip";}
{name = "nvim_lsp";}
{name = "nvim_lua";}
{name = "nvim_lsp_signature_help";}
{name = "nvim_lsp_document_symbol";}
{name = "path";}
{name = "rg";}
{name = "spell";}
{name = "tmux";}
{name = "treesitter";}
];
view = {
entries = {
name = "custom";
selection_order = "near_cursor";
};
};
window = {
completion = { completion = {
inherit border; documentation.window.border = "rounded";
menu.border = "rounded";
}; };
documentation = { signature = {
inherit border; window.border = "rounded";
}; };
}; keymap = {
mapping = {
# "<CR>" = "cmp.mapping.confirm({select = true})"; # "<CR>" = "cmp.mapping.confirm({select = true})";
"<CR>" = "cmp.mapping.confirm()"; # "<CR>" = "cmp.mapping.confirm()";
"<C-Space>" = "cmp.mapping.complete()"; # "<C-Space>" = "cmp.mapping.complete()";
"<C-n>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; # "<C-n>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<C-p>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; # "<C-p>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<C-n>" = [
"select_next"
"fallback"
];
"<C-p>" = [
"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"
];
}; };
snippet.expand = sources = {
# lua cmdline = [];
'' default = ["lsp" "dictionary" "snippets" "path" "buffer"];
function(args) providers = {
require('luasnip').lsp_expand(args.body) buffer = {
end score_offset = -7;
''; };
lsp = {
fallbacks = [];
};
path = {};
dictionary = {
module = "blink-cmp-dictionary";
name = "Dict";
min_keyword_length = 3;
opts = {
}; };
}; };
}; };
};
};
};
blink-cmp-dictionary.enable = true;
blink-cmp-git.enable = true;
blink-cmp-copilot.enable = true;
blink-cmp-spell.enable = true;
blink-compat = {
enable = true;
settings.impersonate_nvim_cmp = true;
};
# cmp = {
# enable = true;
# settings = {
# autoEnableSources = true;
# sources = [
# {name = "buffer";}
# {name = "buffer";}
# {name = "cmdline";}
# {name = "cmp-clippy";}
# {name = "cmp-cmdline-history";}
# {name = "crates";}
# {name = "dap";}
# # {name = "dictionary";}
# {name = "fish";}
# {name = "git";}
# {name = "luasnip";}
# {name = "nvim_lsp";}
# {name = "nvim_lua";}
# {name = "nvim_lsp_signature_help";}
# {name = "nvim_lsp_document_symbol";}
# {name = "path";}
# {name = "rg";}
# {name = "spell";}
# {name = "tmux";}
# {name = "treesitter";}
# ];
# view = {
# entries = {
# name = "custom";
# selection_order = "near_cursor";
# };
# };
# window = {
# completion = {
# inherit border;
# };
# documentation = {
# inherit border;
# };
# };
# mapping = {
# # "<CR>" = "cmp.mapping.confirm({select = true})";
# "<CR>" = "cmp.mapping.confirm()";
# "<C-Space>" = "cmp.mapping.complete()";
# "<C-n>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
# "<C-p>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
# };
# snippet.expand =
# # lua
# ''
# function(args)
# require('luasnip').lsp_expand(args.body)
# end
# '';
# };
# };
};
extraConfigLua = extraConfigLua =
# lua # lua
'' ''