Use 4-space indent for C/C++ in nvim
Drop the 2-space C/C++ override and set IndentWidth: 4 in clangd's fallback style so formatting matches the editor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -7,14 +7,10 @@
|
||||
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
|
||||
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
|
||||
|
||||
-- C/C++ uses 2-space indent to match clang-format's LLVM default
|
||||
-- Disable LazyVim's format-on-save for C/C++
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "c", "cpp" },
|
||||
callback = function()
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
-- Disable LazyVim's format-on-save for C/C++
|
||||
vim.b.autoformat = false
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user