aboutsummaryrefslogtreecommitdiff
path: root/common/.flake/home/clang-format.nix.org
blob: f25e482b96473c07298090bae5f77c8acd34f42c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#+title: Clang Format Default Options

Set global =clang-format= options:
- Default to LLVM style
- Use indents of width 4
- Use Linux standards for braces (new line for functions, same line for everything else)
- If statements cannot be on a single line.
- Case labels are not indented.
#+begin_src nix :tangle ~/.flake/home/clang-format.nix :mkdirp yes
  { config, pkgs, ... }:

  {
    home.file.".clang-format".text = ''
      BasedOnStyle: LLVM
      IndentWidth: 4
      BreakBeforeBraces: Linux
      AllowShortIfStatementsOnASingleLine: false
      IndentCaseLabels: false
    '';
  }
#+end_src