From 868be17249c67ee410e086cba03630b62e278cc7 Mon Sep 17 00:00:00 2001
From: Sergey Matveev <stargrave@stargrave.org>
Date: Wed, 22 Apr 2020 15:11:27 +0300
Subject: [PATCH] cfmt.sh is back

---
 bin/bin/cfmt.sh               |  3 +++
 clang-format/.clang-format    | 33 +++++++++++++++++----------------
 vim/.vim/ftplugin/c/autos.vim |  2 +-
 3 files changed, 21 insertions(+), 17 deletions(-)
 create mode 100755 bin/bin/cfmt.sh

diff --git a/bin/bin/cfmt.sh b/bin/bin/cfmt.sh
new file mode 100755
index 0000000..5cf5c4c
--- /dev/null
+++ b/bin/bin/cfmt.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+clang-format60 -style="`cat ~/.clang-format`" $@
diff --git a/clang-format/.clang-format b/clang-format/.clang-format
index 2c6edf9..4e0d794 100644
--- a/clang-format/.clang-format
+++ b/clang-format/.clang-format
@@ -1,16 +1,17 @@
-BasedOnStyle: llvm
-ColumnLimit: 88
-IndentWidth: 4
-AlignAfterOpenBracket: AlwaysBreak
-AlignConsecutiveAssignments: true
-AllowAllParametersOfDeclarationOnNextLine: false
-AllowShortBlocksOnASingleLine: true
-AllowShortCaseLabelsOnASingleLine: true
-BinPackArguments: false
-BinPackParameters: false
-BreakBeforeTernaryOperators: false
-BreakStringLiterals: false
-
-BreakBeforeBraces: Custom
-BraceWrapping:
-    AfterFunction: true
+{
+    BasedOnStyle: llvm,
+    ColumnLimit: 88,
+    IndentWidth: 4,
+    AlignAfterOpenBracket: AlwaysBreak,
+    AlignConsecutiveAssignments: true,
+    AllowAllParametersOfDeclarationOnNextLine: false,
+    AllowShortBlocksOnASingleLine: true,
+    BinPackArguments: false,
+    BinPackParameters: false,
+    BreakBeforeTernaryOperators: false,
+    BreakStringLiterals: false,
+    BreakBeforeBraces: Custom,
+    BraceWrapping: {
+        AfterFunction: true,
+    },
+}
diff --git a/vim/.vim/ftplugin/c/autos.vim b/vim/.vim/ftplugin/c/autos.vim
index b0f7c2d..1eb3aae 100644
--- a/vim/.vim/ftplugin/c/autos.vim
+++ b/vim/.vim/ftplugin/c/autos.vim
@@ -1,3 +1,3 @@
-setlocal equalprg=clang-format60
+setlocal equalprg=cfmt.sh
 setlocal commentstring=//\ %s
 command! -buffer Fmt normal mtgg=G'tz.
-- 
2.51.0