p00f / clangd_extensions.nvim

Clangd's off-spec features for neovim's LSP client. Use https://sr.ht/~p00f/clangd_extensions.nvim instead
MIT License
448 stars 16 forks source link

Disable auto-indent for namespace #22

Closed ruffson closed 2 years ago

ruffson commented 2 years ago

I know that this might not be an issue with this extension but it may be helpful to ask anyway:

Is there any way to disable the rather aggressive auto-indentation within a namespace? I don't want code inside the namespace to be indented but even after I manually remove the initial indentation, after adding e.g. a class, the indentation of the whole block is re-done which makes it pretty impossible to keep stuff inside a namespace non-indented. Example video below:

https://user-images.githubusercontent.com/1185812/179371283-c741eb8d-f132-4c9c-bd2f-83e9566f7169.mp4

p00f commented 2 years ago

I don't think this is related to lsp at all, you need to set your indentexpr for C++

p00f commented 2 years ago

https://stackoverflow.com/questions/2549019/how-to-avoid-namespace-content-indentation-in-vim

ruffson commented 2 years ago

Thank you!