From 29264ecaa8307c01e32978ad8cc52781cfafdb9b Mon Sep 17 00:00:00 2001 From: Aotrix <9aotrix@protonmail.com> Date: Sat, 31 Jan 2026 21:08:13 +0100 Subject: added conditional breakpoint shortcut and virtual text --- lua/aotrix/plugins/lsp.lua | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'lua/aotrix/plugins/lsp.lua') diff --git a/lua/aotrix/plugins/lsp.lua b/lua/aotrix/plugins/lsp.lua index c55aa0b..484f289 100644 --- a/lua/aotrix/plugins/lsp.lua +++ b/lua/aotrix/plugins/lsp.lua @@ -6,7 +6,7 @@ return { config = function() require("mason").setup() require("mason-lspconfig").setup({ - ensure_installed = { "cmake", "lua_ls" } + ensure_installed = {"cmake", "lua_ls"} }) vim.lsp.config["clangd"] = { cmd = { @@ -14,25 +14,20 @@ return { "--header-insertion=iwyu", "--completion-style=detailed", "--function-arg-placeholders", "--fallback-style=llvm" }, - root_markers = { { "CMakeLists.txt", - "Makefile", - "configure.ac", - "configure.in", - "config.h.in", - "meson.build", - "meson_options.txt", - "build.ninja" }, - { "compile_commands.json", "compile_flags.txt" }, - { ".git" } }, - filetypes = { "cpp", "hpp", "c", "h" }, + root_markers = { + { + "CMakeLists.txt", "Makefile", "configure.ac", + "configure.in", "config.h.in", "meson.build", + "meson_options.txt", "build.ninja" + }, {"compile_commands.json", "compile_flags.txt"}, {".git"} + }, + filetypes = {"cpp", "hpp", "c", "h"}, capabilities = { - offsetEncoding = { "utf-16" }, + offsetEncoding = {"utf-16"}, textDocument = { - semanticTokens = { - multilineTokenSupport = true, - }, - completion = { completionItem = { snippetSupport = true } } + semanticTokens = {multilineTokenSupport = true}, + completion = {completionItem = {snippetSupport = true}} } }, init_options = { @@ -41,12 +36,13 @@ return { clangdFileStatus = true } } + vim.diagnostic.config({virtual_text = true}) vim.keymap.set("n", "o", "LspClangdSwitchSourceHeader") vim.lsp.config["cmake"] = {} vim.lsp.config["lua_ls"] = { - settings = { completion = { callSnippet = 'Replace' } } + settings = {completion = {callSnippet = 'Replace'}} } vim.lsp.enable("clangd") -- cgit v1.2.3