summaryrefslogtreecommitdiffstats
path: root/after/lsp/clangd.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2025-05-08 18:18:34 -0500
committerSquibid <me@zacharyscheiman.com>2025-05-08 18:18:34 -0500
commit7430ebed8eab0364452a6cdcaa209f8a7288e44d (patch)
treecd80b99c41c4af92c7a130fe52ca462062697d22 /after/lsp/clangd.lua
parent7c3289fded1f75f6e060f56bd06edc2a327744d9 (diff)
downloadnvim-3.0.tar.gz
nvim-3.0.tar.bz2
nvim-3.0.zip
kitchen sink now don't support any version lower than 0.11.0 for lspv3.0
- dap now works for java and c
Diffstat (limited to 'after/lsp/clangd.lua')
-rw-r--r--after/lsp/clangd.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/after/lsp/clangd.lua b/after/lsp/clangd.lua
new file mode 100644
index 0000000..b1919c8
--- /dev/null
+++ b/after/lsp/clangd.lua
@@ -0,0 +1,27 @@
+local map = require("core.misc").map
+
+return {
+ on_attach = function(_, bufnr)
+ -- add some clangd specific mappings
+ local opts = { buffer = bufnr }
+ map("n", "<leader>o", "<cmd>ClangdSwitchSourceHeader<CR>", opts)
+ end,
+
+ cmd = {
+ "clangd",
+ "--background-index",
+ "--clang-tidy",
+ "--header-insertion=iwyu",
+ "--completion-style=detailed",
+ "--function-arg-placeholders",
+ "--fallback-style=llvm"
+ },
+
+ init_options = {
+ usePlaceholders = true,
+ clangdFileStatus = true,
+ fallback_flags = {
+ "-xc" -- makes clangd think we"re using c instead of c++
+ }
+ }
+}