Files
dotfiles/nvim/.config/nvim/lua/plugins/languages/clang.lua
T

68 lines
1.2 KiB
Lua

return {
-- C/C++ formatter configuration
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
-- Format C source files
c = { "clang_format" },
-- Format C header files
h = { "clang_format" },
-- Format C++ source files
cpp = { "clang_format" },
-- Format C++ header files
hpp = { "clang_format" },
},
},
},
-- C/C++ language server configuration
{
"neovim/nvim-lspconfig",
opts = {
servers = {
clangd = {
-- Enable additional clangd features
capabilities = {
offsetEncoding = { "utf-16" },
},
-- clangd command options
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
},
},
},
},
},
-- Install C/C++ tools through Mason
{
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"clangd",
"clang-format",
},
},
},
-- Treesitter support for C/C++
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"c",
"cpp",
},
},
},
}