diff --git a/init.lua b/init.lua index 7e1f1f2a..bf934c54 100644 --- a/init.lua +++ b/init.lua @@ -82,8 +82,6 @@ vim.opt.expandtab = true vim.opt.shiftwidth = 4 vim.opt.tabstop = 4 vim.opt.softtabstop = 4 -vim.opt.smartindent = true -vim.opt.autoindent = true -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -118,6 +116,19 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- LuaSnip snippet navigation +vim.keymap.set({ 'i', 's' }, '', function() + if require('luasnip').jumpable(1) then + require('luasnip').jump(1) + end +end, { desc = 'Jump to next snippet placeholder' }) + +vim.keymap.set({ 'i', 's' }, '', function() + if require('luasnip').jumpable(-1) then + require('luasnip').jump(-1) + end +end, { desc = 'Jump to previous snippet placeholder' }) + -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes -- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) -- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) @@ -761,6 +772,16 @@ require('lazy').setup({ }, 'folke/lazydev.nvim', }, + + config = function(_, opts) + require('luasnip').setup { + history = true, + region_check_events = 'InsertEnter', + delete_check_events = 'TextChanged,InsertLeave', + } + + require('blink.cmp').setup(opts) + end, --- @module 'blink.cmp' --- @type blink.cmp.Config opts = {