Friendly snippets, <tab> for blink.cmp

pull/1661/head
lootboxer 3 months ago
parent 120ba18e67
commit 392e633f0e

@ -858,12 +858,12 @@ require('lazy').setup({
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
-- {
-- 'rafamadriz/friendly-snippets',
-- config = function()
-- require('luasnip.loaders.from_vscode').lazy_load()
-- end,
-- },
{
'rafamadriz/friendly-snippets',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
},
opts = {},
},
@ -896,6 +896,18 @@ require('lazy').setup({
-- See :h blink-cmp-config-keymap for defining your own keymap
preset = 'default',
['<Tab>'] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_and_accept()
end
end,
'snippet_forward',
'fallback',
},
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
@ -910,6 +922,9 @@ require('lazy').setup({
-- By default, you may press `<c-space>` to show the documentation.
-- Optionally, set `auto_show = true` to show the documentation after a delay.
documentation = { auto_show = false, auto_show_delay_ms = 500 },
ghost_text = {
enabled = true,
},
},
sources = {

Loading…
Cancel
Save