about summary refs log tree commit diff
path: root/fish/.local/etc/fish/conf.d/bear.fish
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fish/.local/etc/fish/conf.d/bear.fish22
1 files changed, 22 insertions, 0 deletions
diff --git a/fish/.local/etc/fish/conf.d/bear.fish b/fish/.local/etc/fish/conf.d/bear.fish
new file mode 100644
index 0000000..096ba44
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/bear.fish
@@ -0,0 +1,22 @@
+if command -s bear &>/dev/null
+    set alts
+    set -a remake
+    set -a make
+
+    for i in $alts
+        if command -s $i &>/dev/null
+            set bear_base="bear --include=./include --include=../include $i"
+            if command -s nproc &>/dev/null
+                alias m "$bear_base --jobs=(math (nproc) + 1)"
+            else
+                alias m "$bear_base"
+            end
+            set -e bear_base
+
+            alias mc "m clean"
+
+            break
+        end
+    end
+    set -e alts
+end

Consider giving Nix/NixOS a try! <3