summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--after/lsp/clangd.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/after/lsp/clangd.lua b/after/lsp/clangd.lua
new file mode 100644
index 0000000..0372d3d
--- /dev/null
+++ b/after/lsp/clangd.lua
@@ -0,0 +1,12 @@
+return {
+ -- Command and arguments to start the server.
+ cmd = { 'clangd' },
+ -- Filetypes to automatically attach to.
+ filetypes = { 'c', 'cpp', 'h', 'hpp' },
+ -- Sets the "root directory" to the parent directory of the file in the
+ -- current buffer that contains either a ".luarc.json" or a
+ -- ".luarc.jsonc" file. Files that share a root directory will reuse
+ -- the connection to the same LSP server.
+ -- Nested lists indicate equal priority, see |vim.lsp.Config|.
+ root_markers = { '.clangd', 'compile_commands.json' },
+}