summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toast.cafe>2022-02-18 16:44:26 -0500
committerChloe Kudryavtsev <toast@toast.cafe>2022-02-18 16:44:26 -0500
commit667d1c5a27706f01ddd86595d96aa0a9f6797fec (patch)
treef4bd6e61d2dc58767c7c8948a232927b6db7af4b
parentadd batdiff (diff)
add fossil-related shortcuts and completions
-rw-r--r--dot_config/private_fish/completions/f.fish12
-rw-r--r--dot_local/bin/executable_fossil-diff2
-rw-r--r--dot_local/bin/executable_fossil-log5
3 files changed, 19 insertions, 0 deletions
diff --git a/dot_config/private_fish/completions/f.fish b/dot_config/private_fish/completions/f.fish
new file mode 100644
index 0000000..99796c6
--- /dev/null
+++ b/dot_config/private_fish/completions/f.fish
@@ -0,0 +1,12 @@
+# f wraps fossil by default
+complete -c f -w fossil
+
+# additional subcommands
+set -l dcommands (fossil help -a)
+set -l paths $PATH/fossil-*
+set -l commands (string replace -r '.*fossil-' '' $paths)
+
+if set -q commands[1]
+ complete -c fossil -n "not __fish_seen_subcommand_from $dcommands" \
+ -a "$commands"
+end
diff --git a/dot_local/bin/executable_fossil-diff b/dot_local/bin/executable_fossil-diff
new file mode 100644
index 0000000..f145661
--- /dev/null
+++ b/dot_local/bin/executable_fossil-diff
@@ -0,0 +1,2 @@
+#!/bin/sh
+fossil diff "$@" --command batdiff
diff --git a/dot_local/bin/executable_fossil-log b/dot_local/bin/executable_fossil-log
new file mode 100644
index 0000000..ea922af
--- /dev/null
+++ b/dot_local/bin/executable_fossil-log
@@ -0,0 +1,5 @@
+#!/bin/sh
+YELLOW=$(echo '\x1b[0;33m')
+NORMAL=$(echo '\x1b[0m')
+
+exec fossil timeline -F "${YELLOW}[%h]${NORMAL} %c" "$@"