-- Set some settings for competion -- For more info type `:help completeopt` -- menu: Show menu when completions available (more than 1) -- menuone: Show menu even when there is only 1 option -- noselect: Force user to select convinient option vim.opt.completeopt = { "menu", "menuone", "noselect" } local lspkind = require "lspkind" local kind_formatter = lspkind.cmp_format { mode = "symbol_text", menu = { buffer = "[buf]", nvim_lsp = "[LSP]", nvim_lua = "[api]", path = "[path]", luasnip = "[snip]", gh_issues = "[issues]", tn = "[TabNine]", eruby = "[erb]", }, } local cmp = require "cmp" cmp.setup { sources = { { name = "nvim_lsp" }, { name = "path" }, { name = "buffer" }, }, mapping = { [""] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }, [""] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }, [""] = cmp.mapping( cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Insert, select = true, }, { "i", "c" } ), }, }