-- Autocmds are automatically loaded on the VeryLazy event -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua -- Add any additional autocmds here vim.api.nvim_create_autocmd("FileType", { pattern = { "lua" }, callback = function() vim.bo.tabstop = 2 vim.bo.softtabstop = 2 vim.bo.shiftwidth = 2 end, }) local cmp = require("cmp") cmp.setup({ mapping = { [""] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.confirm({ select = false }) else fallback() -- Insert a new line if completion is not visible end end, { "i", "s" }), -- 'i' for insert mode, 's' for select mode }, })