aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
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