fixed my super tab functionality

This commit is contained in:
Daveanand Mannie
2024-09-02 22:09:06 -04:00
parent 4396b9442b
commit 1123686a26
2 changed files with 15 additions and 10 deletions

View File

@@ -12,13 +12,3 @@ vim.cmd("colorscheme wildcharm")
-- increase the time before whichkey pops up -- increase the time before whichkey pops up
vim.o.timeoutlen = 1400 vim.o.timeoutlen = 1400
--tab auto complete
local cmp = require'cmp'
cmp.setup({
mapping = {
['<Tab>'] = cmp.mapping.confirm({ select = true }),
}
})

View File

@@ -9,3 +9,18 @@ vim.api.nvim_create_autocmd("FileType", {
vim.bo.shiftwidth = 2 vim.bo.shiftwidth = 2
end, end,
}) })
local cmp = require("cmp")
cmp.setup({
mapping = {
["<Tab>"] = cmp.mapping.confirm({ select = true }),
["<CR>"] = 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
},
})