-
|
With Note that I do get path completions in
But in insert mode, they just won't show up. When explicitly calling path provider with a keybinding (see full config below), all I get is a
nvf [
"lsp"
"path"
"snippets"
"buffer"
]so I guess it should work out of the box? Especially considering the other ones work fine. :checkhealth blink.cmpMy full blink Nix config{
lib,
pkgs,
...
}: {
programs.nvf.settings = {
vim.extraPlugins = {
"colorful-menu.nvim" = {
package = pkgs.vimPlugins.colorful-menu-nvim;
};
};
vim.autocomplete."blink-cmp" = {
enable = true;
friendly-snippets.enable = true;
sourcePlugins.emoji.enable = true;
setupOpts = {
keymap = {
preset = "enter";
"<C-b>" = [
(lib.generators.mkLuaInline
# lua
''
function(cmp)
cmp.show({ providers = { 'path' } })
end
'')
];
};
completion = {
list = {
selection = {
preselect =
lib.generators.mkLuaInline
# lua
''
function(ctx)
return ctx.mode ~= "cmdline" and not require("blink.cmp").snippet_active({ direction = 1 })
end,
auto_insert = function(ctx)
return ctx.mode == "cmdline"
end
'';
};
};
menu = {
auto_show = false;
draw = {
columns =
lib.generators.mkLuaInline
# lua
''
{
{ "kind_icon" },
{ "label", gap = 1 },
}
'';
components = {
kind_icon = {
ellipsis = false;
text =
lib.generators.mkLuaInline
# lua
''
function(ctx)
local kind_icon, _, _ = require("mini.icons").get("lsp", ctx.kind)
return kind_icon
end
'';
highlight =
lib.generators.mkLuaInline
# lua
''
function(ctx)
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
return hl
end
'';
};
label = {
text =
lib.generators.mkLuaInline
# lua
''
function(ctx)
return require("colorful-menu").blink_components_text(ctx)
end
'';
highlight =
lib.generators.mkLuaInline
# lua
''
function(ctx)
return require("colorful-menu").blink_components_highlight(ctx)
end
'';
};
};
treesitter = ["lsp"];
};
scrollbar = false;
};
};
signature.enabled = true;
};
};
};
}output config displayed by nvf-print-configrequire("lz.n").load({
{
"blink-cmp",
["after"] = function()
require("blink.cmp").setup({
["cmdline"] = {
["keymap"] = {
["<C-Space>"] = { "show", "fallback" },
["<C-d>"] = { "scroll_documentation_up", "fallback" },
["<C-e>"] = { "hide", "fallback" },
["<C-f>"] = { "scroll_documentation_down", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
["<Tab>"] = { "select_next", "show", "fallback" },
["preset"] = "none",
},
},
["completion"] = {
["documentation"] = { ["auto_show"] = true, ["auto_show_delay_ms"] = 200 },
["list"] = {
["selection"] = {
["preselect"] = function(ctx)
return ctx.mode ~= "cmdline" and not require("blink.cmp").snippet_active({ direction = 1 })
end,
auto_insert = function(ctx)
return ctx.mode == "cmdline"
end,
},
},
["menu"] = {
["auto_show"] = false,
["draw"] = {
["columns"] = {
{ "kind_icon" },
{ "label", gap = 1 },
},
["components"] = {
["kind_icon"] = {
["ellipsis"] = false,
["highlight"] = function(ctx)
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
return hl
end,
["text"] = function(ctx)
local kind_icon, _, _ = require("mini.icons").get("lsp", ctx.kind)
return kind_icon
end,
},
["label"] = {
["highlight"] = function(ctx)
return require("colorful-menu").blink_components_highlight(ctx)
end,
["text"] = function(ctx)
return require("colorful-menu").blink_components_text(ctx)
end,
},
},
["treesitter"] = { "lsp" },
},
["scrollbar"] = false,
},
},
["fuzzy"] = { ["implementation"] = "prefer_rust", ["prebuilt_binaries"] = { ["download"] = false } },
["keymap"] = {
["<C-Space>"] = { "show", "fallback" },
["<C-b>"] = {
function(cmp)
cmp.show({ providers = { "path" } })
end,
},
["<C-d>"] = { "scroll_documentation_up", "fallback" },
["<C-e>"] = { "hide", "fallback" },
["<C-f>"] = { "scroll_documentation_down", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
["<Tab>"] = {
"select_next",
"snippet_forward",
function(cmp)
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
has_words_before = col ~= 0
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
if has_words_before then
return cmp.show()
end
end,
"fallback",
},
["preset"] = "enter",
},
["signature"] = { ["enabled"] = true },
["sources"] = {
["default"] = { "lsp", "path", "snippets", "buffer", "buffer", "nvim-cmp", "path", "emoji" },
["providers"] = {
["buffer"] = { ["module"] = "blink.compat.source", ["name"] = "buffer" },
["emoji"] = { ["module"] = "blink-emoji", ["name"] = "emoji" },
["nvim-cmp"] = { ["module"] = "blink.compat.source", ["name"] = "nvim-cmp" },
["path"] = { ["module"] = "blink.compat.source", ["name"] = "path" },
},
},
})
end,
},
})This line looks suspicious (duplicate ["default"] = { "lsp", "path", "snippets", "buffer", "buffer", "nvim-cmp", "path", "emoji" },nvf/modules/plugins/completion/blink-cmp/config.nix Lines 69 to 90 in 8fbecab Any idea what could be the issue? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Path completion work just fine if I setup full config {
lib,
pkgs,
...
}:
{
programs.nvf.settings.vim = {
extraPlugins = with pkgs.vimPlugins; {
"colorful-menu.nvim" = {
package = colorful-menu-nvim;
};
"friendly-snippets" = {
package = friendly-snippets;
};
"blink-emoji.nvim" = {
package = blink-emoji-nvim;
};
};
lazy.plugins = {
"blink.cmp" = {
enabled = true;
event = [ "InsertEnter" ];
package = pkgs.vimPlugins.blink-cmp;
setupModule = "blink.cmp";
setupOpts = {
keymap.preset = "enter";
completion = {
list = {
selection = {
preselect =
lib.generators.mkLuaInline
# lua
''
function(ctx)
return ctx.mode ~= "cmdline" and not require("blink.cmp").snippet_active({ direction = 1 })
end,
auto_insert = function(ctx)
return ctx.mode == "cmdline"
end
'';
};
};
menu = {
auto_show = false;
draw = {
columns =
lib.generators.mkLuaInline
# lua
''
{
{ "kind_icon" },
{ "label", gap = 1 },
}
'';
components = {
kind_icon = {
ellipsis = false;
text =
lib.generators.mkLuaInline
# lua
''
function(ctx)
local kind_icon, _, _ = require("mini.icons").get("lsp", ctx.kind)
return kind_icon
end
'';
highlight =
lib.generators.mkLuaInline
# lua
''
function(ctx)
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
return hl
end
'';
};
label = {
text =
lib.generators.mkLuaInline
# lua
''
function(ctx)
return require("colorful-menu").blink_components_text(ctx)
end
'';
highlight =
lib.generators.mkLuaInline
# lua
''
function(ctx)
return require("colorful-menu").blink_components_highlight(ctx)
end
'';
};
};
treesitter = [ "lsp" ];
};
scrollbar = false;
};
documentation = {
auto_show = true;
auto_show_delay_ms = 200;
};
};
sources = {
default = [
"lsp"
"path"
"snippets"
"buffer"
"emoji"
];
min_keyword_length =
lib.generators.mkLuaInline
# lua
''
function(ctx)
-- Only applies when typing a command, doesn't apply to arguments
if vim.bo.filetype == "markdown" or (ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil) then
return 2
end
return 0
end
'';
providers = {
emoji = {
module = "blink-emoji";
name = "Emoji";
};
};
};
signature.enabled = true;
};
};
};
};
} |
Beta Was this translation helpful? Give feedback.


Fixed with 626ad99