Updated blink config
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
return {
|
return {
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
dependencies = "rafamadriz/friendly-snippets",
|
dependencies = {
|
||||||
enabled = false,
|
"rafamadriz/friendly-snippets",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
},
|
||||||
|
-- enabled = false,
|
||||||
version = "*",
|
version = "*",
|
||||||
config = function()
|
config = function()
|
||||||
require("blink-cmp").setup({
|
require("blink-cmp").setup({
|
||||||
@@ -10,31 +13,52 @@ return {
|
|||||||
nerd_font_variant = "mono",
|
nerd_font_variant = "mono",
|
||||||
},
|
},
|
||||||
keymap = {
|
keymap = {
|
||||||
preset = "enter",
|
preset = "default",
|
||||||
|
|
||||||
["<C-space>"] = {},
|
["<C-space>"] = {},
|
||||||
["<C-e>"] = {},
|
["<C-e>"] = {},
|
||||||
|
|
||||||
["<C-c>"] = { "show", "show_documentation", "hide_documentation" },
|
["<C-c>"] = { "show", "show_documentation", "hide_documentation" },
|
||||||
|
["<NL>"] = { "select_and_accept" },
|
||||||
|
|
||||||
|
["<Up>"] = { "select_prev", "fallback" },
|
||||||
|
["<Down>"] = { "select_next", "fallback" },
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
menu = {
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
|
documentation = {
|
||||||
|
auto_show = true,
|
||||||
|
window = {
|
||||||
|
border = "single",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snippets = {
|
||||||
|
preset = "luasnip",
|
||||||
|
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,
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
default = { "lsp", "luasnip", "snippets", "buffer", "path" },
|
default = { "lsp", "snippets", "buffer", "path" },
|
||||||
providers = {
|
providers = {
|
||||||
lsp = {
|
lsp = {
|
||||||
name = "lsp",
|
name = "lsp",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
module = "blink.cmp.sources.lsp",
|
module = "blink.cmp.sources.lsp",
|
||||||
-- kind = "LSP",
|
|
||||||
-- fallbacks = { "snippets", "luasnip", "buffer" },
|
|
||||||
score_offset = 90,
|
score_offset = 90,
|
||||||
},
|
},
|
||||||
luasnip = {
|
|
||||||
name = "luasnip",
|
|
||||||
enabled = true,
|
|
||||||
module = "blink.cmp.sources.luasnip",
|
|
||||||
min_keyword_length = 2,
|
|
||||||
-- fallbacks = { "snippets" },
|
|
||||||
score_offset = 85,
|
|
||||||
},
|
|
||||||
snippets = {
|
snippets = {
|
||||||
name = "snippets",
|
name = "snippets",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
@@ -43,14 +67,14 @@ return {
|
|||||||
},
|
},
|
||||||
buffer = {
|
buffer = {
|
||||||
name = "Buffer",
|
name = "Buffer",
|
||||||
|
enabled = true,
|
||||||
module = "blink.cmp.sources.buffer",
|
module = "blink.cmp.sources.buffer",
|
||||||
min_keyword_length = 2,
|
score_offset = 70,
|
||||||
},
|
},
|
||||||
path = {
|
path = {
|
||||||
name = "Path",
|
name = "Path",
|
||||||
module = "blink.cmp.sources.path",
|
module = "blink.cmp.sources.path",
|
||||||
score_offset = 3,
|
score_offset = 3,
|
||||||
fallbacks = { "snippets", "luasnip", "buffer" },
|
|
||||||
opts = {
|
opts = {
|
||||||
trailing_slash = false,
|
trailing_slash = false,
|
||||||
label_trailing_slash = true,
|
label_trailing_slash = true,
|
||||||
|
|||||||
Reference in New Issue
Block a user