Friendly snippets, <tab> for blink.cmp
This commit is contained in:
parent
120ba18e67
commit
392e633f0e
27
init.lua
27
init.lua
|
@ -858,12 +858,12 @@ require('lazy').setup({
|
||||||
-- `friendly-snippets` contains a variety of premade snippets.
|
-- `friendly-snippets` contains a variety of premade snippets.
|
||||||
-- See the README about individual language/framework/plugin snippets:
|
-- See the README about individual language/framework/plugin snippets:
|
||||||
-- https://github.com/rafamadriz/friendly-snippets
|
-- https://github.com/rafamadriz/friendly-snippets
|
||||||
-- {
|
{
|
||||||
-- 'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
-- config = function()
|
config = function()
|
||||||
-- require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
-- end,
|
end,
|
||||||
-- },
|
},
|
||||||
},
|
},
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
@ -896,6 +896,18 @@ require('lazy').setup({
|
||||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||||
preset = 'default',
|
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:
|
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
-- 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.
|
-- By default, you may press `<c-space>` to show the documentation.
|
||||||
-- Optionally, set `auto_show = true` to show the documentation after a delay.
|
-- Optionally, set `auto_show = true` to show the documentation after a delay.
|
||||||
documentation = { auto_show = false, auto_show_delay_ms = 500 },
|
documentation = { auto_show = false, auto_show_delay_ms = 500 },
|
||||||
|
ghost_text = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
|
|
Loading…
Reference in New Issue