aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDeposite Pirate2026-02-15 06:38:01 +0100
committerDeposite Pirate2026-02-15 06:38:01 +0100
commit1b433f995233adcd4f7ca451fadbe5065cdc45fb (patch)
tree6a9202807f1bd479ffef7ab7e1eebf5ff2841aea /functions
parent059fb78f19d822305183693a84cd22beeb61a841 (diff)
Fish function synchronisation
new file: functions/funclnk.fish
Diffstat (limited to 'functions')
-rw-r--r--functions/funclnk.fish20
1 files changed, 20 insertions, 0 deletions
diff --git a/functions/funclnk.fish b/functions/funclnk.fish
new file mode 100644
index 0000000..2e83b1b
--- /dev/null
+++ b/functions/funclnk.fish
@@ -0,0 +1,20 @@
+function funclnk --description "Synchronise fish functions symlinks"
+
+set configdir "$HOME/Config"
+set fishfuncdir "$__fish_config_dir/functions"
+
+for script in (find $configdir -type f -path "*/.config/fish/functions/*" -name "*.fish")
+ set -l basescriptname (path basename $script)
+
+ if test -e "$fishfuncdir/$basescriptname"
+ continue
+ end
+
+ if ask "Add a symlink to $basescriptname to fish profile?"
+ pushd $fishfuncdir
+ ln -s (realpath --relative-to=. $script)
+ popd
+ end
+end
+
+end