nix.nvim/nvim/ftplugin/c.lua

19 lines
426 B
Lua
Raw Normal View History

-- Exit if the language server isn't available
if vim.fn.executable('clangd') ~= 1 then
return
end
local root_files = {
'compile_commands.json',
'.vscode',
'.git',
}
vim.lsp.start {
name = 'clangd',
cmd = { 'clangd' },
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
capabilities = require('user.lsp').make_client_capabilities(),
-- capabilities = { offsetEncoding = "utf-8" },
}