We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blink.cmp
<C-k>
I use the luasnip autosnippet, When i trigger, there is still a cmp window. It is undesirable. BUT it I use tab select and accept, it works normally.
tab
return { "saghen/blink.cmp", event = "InsertEnter", dependencies = { { "L3MON4D3/LuaSnip", config = function() require("luasnip.loaders.from_vscode").lazy_load({ paths = "./snippets" }) require("luasnip.loaders.from_lua").lazy_load({ paths = "./snippets_lua" }) end, }, }, version = "*", opts = function() return { snippets = { preset = "luasnip" }, keymap = { -- set to 'none' to disable the 'default' preset ["<Tab>"] = { function(cmp) if cmp.is_visible() then return cmp.select_next() else cmp.hide() return cmp.snippet_forward() end end, "fallback", }, ["<S-Tab>"] = { function(cmp) if cmp.is_visible() then return cmp.select_prev() else cmp.hide() return cmp.snippet_backward() end end, "fallback", }, ["<CR>"] = { "select_and_accept", "fallback", }, }, completion = { keyword = { range = "prefix" }, list = { selection = { preselect = false, auto_insert = true, }, }, }, sources = { default = { "lsp", "path", "snippets", "buffer" }, }, } end, }
autosnippet snippets lua snippets
local treesitter_postfix = require("luasnip.extras.treesitter_postfix").treesitter_postfix local postfix_builtin = require("luasnip.extras.treesitter_postfix").builtin local expr_query = [[ [ (if_statement) (call_expression) (identifier) (type_identifier) (template_function) (subscript_expression) (field_expression) (user_defined_literal) ] @prefix ]] treesitter_postfix( { trig = ".cout", matchTSNode = { query = expr_query, query_lang = "cpp", select = "longest", }, reparseBuffer = "live", snippetType = "autosnippet", }, fmt( [[ cout << {expr} << endl; ]], { expr = f(function(_, parent) return parent.snippet.env.LS_TSMATCH end, {}), } ) ),
json snippets
"example1": { "prefix": "options", "body": ["whoa! :O"], "luasnip": { "priority": 2000, "autotrigger": true, "wordTrig": false } },
neovim
NVIM v0.11.0-dev-1550+g69ad6b12ec-Homebrew (nightly)
0.10.0
The text was updated successfully, but these errors were encountered:
completion = { keyword = { range = "prefix" }, trigger = { show_on_x_blocked_trigger_characters = { "'", '"', "(", "."}, }, } sources = { default = { "lsp", "path", "snippets", "buffer" }, providers = { snippets = { max_items = 4, should_show_items = function(ctx) return ctx.trigger.initial_kind ~= "trigger_character" end, min_keyword_length = 1, -- don't show when triggered manually, useful for JSON keys opts = { use_show_condition = true, show_autosnippets = false, }, }, buffer = { max_items = 5, should_show_items = function(ctx) return ctx.trigger.initial_kind ~= "trigger_character" end, }, }, },
use this config Temporarily resolved the issue triggered by the. in the postfix autosnippet.
.
The issue of direct text triggering like json snippet options above still exists.
options
Sorry, something went wrong.
No branches or pull requests
Make sure you have done the following
blink.cmp
<C-k>
on https://cmp.saghen.dev)Bug Description
I use the luasnip autosnippet, When i trigger, there is still a cmp window. It is undesirable.
BUT it I use
tab
select and accept, it works normally.Screen.Recording.2025-01-16.at.00.09.45.mov
Relevant configuration
autosnippet snippets
lua snippets
json snippets
neovim
versionNVIM v0.11.0-dev-1550+g69ad6b12ec-Homebrew (nightly)
blink.cmp
version0.10.0
The text was updated successfully, but these errors were encountered: