nvim-lspconfig.lua (470B)
1 vim.cmd[[set completeopt+=menuone,noselect,popup]] 2 vim.lsp.config('clangd', { 3 on_attach = function(client, bufnr) 4 local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end 5 client.server_capabilities.completionProvider.triggerCharacters = chars 6 vim.lsp.completion.enable(true, client.id, bufnr, { 7 autotrigger = true, 8 convert = function(item) 9 return { abbr = item.label:gsub('%b()', '')} 10 end, 11 }) 12 end, 13 }) 14 15 vim.lsp.enable('clangd')