Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable GNU-indentation? #25

Closed
lshoravi opened this issue Dec 22, 2018 · 3 comments
Closed

Enable GNU-indentation? #25

lshoravi opened this issue Dec 22, 2018 · 3 comments

Comments

@lshoravi
Copy link

lshoravi commented Dec 22, 2018

When indenting with a region, it automatically places brackets and indentation length to K&R style (or something like that) instead of whatever c-indent-style is. On my system, c-indent-style is set to gnu.

I.e, it goes from:

if (...) 
  {
....
  }

to

if (...) {
....
}
@MaskRay
Copy link
Member

MaskRay commented Dec 22, 2018

The server does not know these Emacs cc-mode variables (e.g. c-indent-style tab-width).

You can achieve this with:

% cat .clang-format
BasedOnStyle: GNU

ccls uses clangFormat which reads the file to decide the style.

@MaskRay MaskRay closed this as completed Dec 22, 2018
@lshoravi
Copy link
Author

Thank you

@lshoravi
Copy link
Author

I can't actually get this to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants