mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-11 09:54:34 +02:00
refactor: still not ideal...
This commit is contained in:
parent
b2e012cb83
commit
0270a39a7b
6 changed files with 89 additions and 59 deletions
|
@ -106,10 +106,22 @@ return {
|
|||
table.insert(opts.sources, { name = "snippets" })
|
||||
end
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>"
|
||||
or LazyVim.cmp.ai_accept()
|
||||
or "<Tab>"
|
||||
end,
|
||||
expr = true, silent = true, mode = "i",
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
-- Neovim enabled snippet navigation mappings by default in v0.11
|
||||
if vim.fn.has("nvim-0.11") == 0 then
|
||||
vim.keymap.set({ "i", "s" }, "<Tab>", function()
|
||||
vim.keymap.set({ "s" }, "<Tab>", function()
|
||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
||||
end, { expr = true, silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue