Reputation: 315
In my LazyVim/NeoVim setup, everytime I save a file, my files are formatted.
Using Mason, I installed clangd LSP and clangd-format. Unfortunately, it always removes the space between consecutive >, which does not allow my Makefile to compile my code. I'm working in C++98 for a school project. As I understand, this is a necessity in code pre C++11, yet the formatter keeps removing this space.
I have been looking for a fix here: https://github.com/clangd/clangd but cannot seem to locate a sort of config file where I could change this option.
Upvotes: 5
Views: 3000
Reputation: 315
Managed to solve this pesky issue. Here are steps below!
clang-format -style=file -dump-config > .clang-format
(you might need to install llvm with brew (MacOS): brew install llvm
)Upvotes: 2