diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 34a747ea..8f1d7968 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -105,26 +105,17 @@ return { table.insert(opts.sources, { name = "snippets" }) end end, - keys = { - { - "", - function() + 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" }, "", function() return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" - end, - expr = true, - silent = true, - mode = { "i", "s" }, - }, - { - "", - function() + end, { expr = true, silent = true }) + vim.keymap.set({ "i", "s" }, "", function() return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" - end, - expr = true, - silent = true, - mode = { "i", "s" }, - }, - }, + end, { expr = true, silent = true }) + end + end, }, -- auto pairs