1

I'm using AstroNvim. I've cloned the template based repo to ~/.config/nvim/lua/user.

How do I configure clangd, for example, to use LLVM code style instead of Google's or to use 4 spaces tab indentation instead of 2?

In general given some plugin like the one in example, what do I have to do to configure it?

I'm pretty new to using Neovim.

1
  • Do you still have something open in your question? How can we help you further? If the answer solves your problem maybe could you accept it using the v button next to the arrow voting buttons. It allow the question to rest :-) Nov 11 at 16:26

1 Answer 1

0

Cpp Formatting Configuration

AstroNvim is using null-ls and that use the LSP formatter to format the code.

The LSP formatter for cpp code is clang. In order to change the way the formatting is configured you have you can consult the following page

Create the ~/.clang-format file with the following content:

BasedOnStyle: LLVM
IndentWidth: 4

Then your .cpp file will be formatted with an indent size of 4 spaces.

AstroVim Plugin configuration

You can use this page of the AstroVim documentation to learn how to configure the AstroVim plugins.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.