From af6a028aa5d2554e3dba2c79009bae3896f7b7e0 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Sat, 21 Dec 2024 01:19:17 +0100 Subject: [PATCH] some blink adjustments --- lua/plugins/blink.lua | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/lua/plugins/blink.lua b/lua/plugins/blink.lua index 528283c..8b2e545 100644 --- a/lua/plugins/blink.lua +++ b/lua/plugins/blink.lua @@ -5,6 +5,7 @@ return { dependencies = { 'rafamadriz/friendly-snippets', 'giuxtaposition/blink-cmp-copilot', + 'L3MON4D3/LuaSnip', { 'saghen/blink.compat', -- use the latest release, via version = '*', if you also use the latest release for blink.cmp @@ -44,7 +45,7 @@ return { -- default list of enabled providers defined so that you can extend it -- elsewhere in your config, without redefining it, via `opts_extend` sources = { - default = { 'lsp', 'path', 'snippets', 'buffer', 'copilot', 'codeium' }, + default = { 'lsp', 'path', 'luasnip', 'buffer', 'copilot', 'codeium' }, -- optionally disable cmdline completions -- cmdline = {}, providers = { @@ -57,13 +58,14 @@ return { codeium = { -- TODO: Replace with https://github.com/Exafunction/codeium.nvim/pull/264 name = 'codeium', -- IMPORTANT: use the same name as you would for nvim-cmp module = 'blink.compat.source', + async = true }, }, }, completion = { list = { - selection = 'manual', + selection = 'auto_insert', }, menu = { max_height = 25, @@ -71,20 +73,29 @@ return { padding = 1, gap = 1, -- treesitter = { 'lsp' }, - -- columns = { - -- { 'kind_icon', width = { fill = true } }, - -- { 'label', 'label_description', gap = 1, highlight = 'BlinkCmpLabelDescription' }, - -- }, }, }, documentation = { auto_show = true, auto_show_delay_ms = 300, + window = { + border = 'padded' + } }, }, -- experimental signature help support - signature = { enabled = true } + signature = { enabled = true }, + snippets = { + expand = function(snippet) require('luasnip').lsp_expand(snippet) end, + active = function(filter) + if filter and filter.direction then + return require('luasnip').jumpable(filter.direction) + end + return require('luasnip').in_snippet() + end, + jump = function(direction) require('luasnip').jump(direction) end, + }, }, -- allows extending the providers array elsewhere in your config -- without having to redefine it