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

Auto format specific extensions #91

Open
solanik opened this issue Jan 16, 2020 · 1 comment
Open

Auto format specific extensions #91

solanik opened this issue Jan 16, 2020 · 1 comment

Comments

@solanik
Copy link

solanik commented Jan 16, 2020

Hi,

AFAIK there's no way to request formatting additional extensions, when formating is done on file save.
I'd like to format files like tpp, cxx and hxx, which are sometimes used throughout projects.

BR

@Kypert
Copy link

Kypert commented Apr 20, 2020

For those extensions, if you have properly setup autocmds[1] (e.g perhaps via autocmd BufRead,BufNewFile *.tpp setfiletype cpp) to detect and set the filetype then g:clang_format#auto_format should still take effect.

Does this cover your needs?

[1]: Currently, it looks like *.cc,*.cpp,*.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl,*.C,*.H,*.tlh are already recognized as filetype cpp by vim/neovim, so that is why I mentioned tpp above.

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