mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
feat: Trying blink.cmp for completions, luasnips not playing nicely yet.
This commit is contained in:
@@ -1,29 +1,57 @@
|
|||||||
return {
|
return {
|
||||||
"saghen/blink.cmp",
|
{
|
||||||
dependencies = {
|
"saghen/blink.cmp",
|
||||||
"rafamadriz/friendly-snippets",
|
dependencies = {
|
||||||
"L3MON4D3/LuaSnip",
|
"rafamadriz/friendly-snippets",
|
||||||
},
|
--"L3MON4D3/LuaSnip",
|
||||||
version = "v0.7.6",
|
|
||||||
opts = {
|
|
||||||
keymap = { preset = "default" },
|
|
||||||
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,
|
|
||||||
},
|
},
|
||||||
sources = {
|
version = "v0.*",
|
||||||
default = { "lsp", "path", "luasnip", "buffer" },
|
opts = {
|
||||||
|
appearance = {
|
||||||
|
use_nvim_cmp_as_default = true,
|
||||||
|
nerd_font_variant = "mono",
|
||||||
|
},
|
||||||
|
signature = { enabled = true },
|
||||||
|
keymap = {
|
||||||
|
preset = "default",
|
||||||
|
["<CR>"] = { "accept", "fallback" },
|
||||||
|
["<C-space>"] = {
|
||||||
|
function(cmp)
|
||||||
|
cmp.show({ providers = { "snippets" } })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
--["<C-k>"] = { "select_prev", "fallback" },
|
||||||
|
--["<C-j>"] = { "select_next", "fallback" },
|
||||||
|
["<C-n>"] = {
|
||||||
|
function(cmp)
|
||||||
|
if cmp.snippet_active() then
|
||||||
|
return cmp.accept()
|
||||||
|
else
|
||||||
|
return cmp.select_and_accept()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
"snippet_forward",
|
||||||
|
"fallback",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- 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,
|
||||||
|
-- },
|
||||||
|
sources = {
|
||||||
|
default = { "lsp", "path", "snippets", "buffer" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
opts_extend = { "sources.default" },
|
||||||
},
|
},
|
||||||
opts_extend = { "sources.default" },
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
|
version = "v2.*",
|
||||||
config = function()
|
config = function()
|
||||||
local ls = require("luasnip")
|
local ls = require("luasnip")
|
||||||
local types = require("luasnip.util.types")
|
local types = require("luasnip.util.types")
|
||||||
|
|||||||
Reference in New Issue
Block a user