From dfc95fc544b8e78d19be8dfe6d076b0c3f27d889 Mon Sep 17 00:00:00 2001 From: anbit Date: Tue, 25 Jun 2024 12:42:04 +0200 Subject: [PATCH] Update lsp configuration clang --- init.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 4f7af0e4..047fee94 100644 --- a/init.lua +++ b/init.lua @@ -100,6 +100,7 @@ vim.g.have_nerd_font = false -- Make line numbers default vim.opt.number = true +vim.opt.relativenumber = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! -- vim.opt.relativenumber = true @@ -609,7 +610,9 @@ require('lazy').setup({ 'stylua', -- Used to format Lua code }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } - require('lspconfig').clangd.setup {} + require('lspconfig').clangd.setup { + capabilities = vim.tbl_deep_extend('force', {}, capabilities), + } require('mason-lspconfig').setup { handlers = { function(server_name) @@ -644,7 +647,7 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + local disable_filetypes = { c = false, cpp = true } return { timeout_ms = 500, lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], @@ -718,10 +721,13 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item + [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + -- Scroll the documentation window [b]ack / [f]orward [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), @@ -729,13 +735,11 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { select = true }, -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display