How can I set .clang-format globally?
See original GitHub issueI’m struggling with this problem for hours.
As far as I know, clangd doesn’t have -style
option unlike clang-format and there’s no way to set my custom format in my coc.nvim + coc-clang environment (I found -fallback-style
option but it is not customizable because it is a kind of presets).
So, is there any way to set a global formating option like vim-clang-format?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Configuring VSC clang format with global.clang-format file
So my first approach was to relocate the clang-file into the "VSC 1.43\data" directory. My second attempt was to locate it right inside...
Read more >ClangFormat — Clang 16.0.0git documentation
With this integration you can press the bound key and clang-format will format the current line in NORMAL and INSERT mode or the...
Read more >How to set up clang-format in Visual Studio Code in a Vagrant ...
Define the location of the clang-format “clang-format. · Define your clang-format style. I just used Google's. · Set your editor to format on...
Read more >ClangFormat as alternative formatter - CLion - JetBrains
If there is no .clang-format file under the project root, CLion will suggest creating it based on the current IDE code style settings....
Read more >Clang format - Mesos - Read the Docs
Setup · Install clang-format-3.5 · Formatting Configuration · Editor Integration.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What I did to work this around is to copy my
.clang-format
fallback at the root of my system. Whether I edit a file in/tmp
,/etc
,/whatever
, it will always end up using/.clang-format
. This is dirty af but it works… If you have a.clang-format
further down the tree it will be used instead.Sent out https://reviews.llvm.org/D95538 for the latter issue.