diff --git a/.config/nvim/lua/josean/plugins/nvim-cmp.lua b/.config/nvim/lua/josean/plugins/nvim-cmp.lua index f38f474..af886b4 100644 --- a/.config/nvim/lua/josean/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/josean/plugins/nvim-cmp.lua @@ -21,12 +21,6 @@ require("luasnip/loaders/from_vscode").lazy_load() vim.opt.completeopt = "menu,menuone,noselect" --- helper function for super tab functionality (not in youtube nvim video) -local has_words_before = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil -end - cmp.setup({ snippet = { expand = function(args) @@ -41,29 +35,6 @@ cmp.setup({ [""] = cmp.mapping.complete(), -- show completion suggestions [""] = cmp.mapping.abort(), -- close completion window [""] = cmp.mapping.confirm({ select = false }), - - -- super tab functionality (not in youtube nvim video) - [""] = cmp.mapping(function(fallback) -- use tab for next suggestion - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - - [""] = cmp.mapping(function(fallback) -- use shift-tab for prev suggestion - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), }), -- sources for autocompletion sources = cmp.config.sources({