Setup Auto-Formatting For C++ Files In Neovim On A Mac

Turns out all I had to do was uncomment `clangd = {}`` in the `local servers`` section of my _~/.config/nvim/init.lua__ file to turn on the clangd LSP. (I already had clangd installed)

I think the LSP config with the commented out clangd server was from the _kickstart.nvim__^ks^^ config file I'm using.

Old Scratchpad Notes

These are scratchpad notes I took while figuring things out. Leaving them here as reference.

  • Installed clang-format with:

    `brew install clang-format``

  • Video with clangd instead of clang-format

    this vid uses nvim-lspconfig which I already had installed

  • clangd installation

    (I already had it installed)


Reference Links To Add







  • (not what i ended up with but it was referenced a few times)

  • - another appraoch with different tools. This is what I was looking at first, but when I figured out I could use the LSP I went that direction

  • pointers to some built-in help files for formatting, but not super useful and it doesn't use the LSP



I got turned onto this from TJ DeVries who works on Neovim. It's worked well as a basic starter for me.


Set up for C++/C Development in Neovim

This is the post that got me started. It has instruction for auto-completion as well as formatting. I'll get to that at some point, but my immediate concern is the formatting.