From 2140ab51deed88e90eafebf9520fa5f9995dc7c9 Mon Sep 17 00:00:00 2001 From: twells46 <173561638+twells46@users.noreply.github.com> Date: Wed, 31 Dec 2025 13:28:05 -0600 Subject: Migrate from stow --- dot_config/fish/functions/zi.fish | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 dot_config/fish/functions/zi.fish (limited to 'dot_config/fish/functions/zi.fish') diff --git a/dot_config/fish/functions/zi.fish b/dot_config/fish/functions/zi.fish new file mode 100644 index 0000000..c529662 --- /dev/null +++ b/dot_config/fish/functions/zi.fish @@ -0,0 +1,17 @@ +if ! builtin functions --query __zoxide_cd_internal + string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source +end +function __zoxide_cd + if set -q __zoxide_loop + builtin echo "zoxide: infinite loop detected" + builtin echo "Avoid aliasing `cd` to `z` directly, use `zoxide init --cmd=cd fish` instead" + return 1 + end + __zoxide_loop=1 __zoxide_cd_internal $argv +end + +# Jump to a directory using interactive search. +function zi + set -l result (command zoxide query --interactive -- $argv) + and __zoxide_cd $result +end -- cgit v1.2.3