zoxide
zoxide copied to clipboard
using --cmd with init in fish config configuration doesn't replace the cd command
using --cmd in fish config configuration doesn't replace the cd command
I have reopened three times.
here is my configuration:
#if test $(defaults read -globalDomain AppleInterfaceStyle) = "Dark"
# base16-tomorrow-night-eighties
#else
# base16-tomorrow
#end
#function starship_transient_prompt_func
# starship module character
#end
#starship init fish | source
#enable_transience
#function fish_right_prompt_loading_indicator
# echo (set_color '#aaa')' … '(set_color normal)
#end
function _git_branch_name
sleep 1 # For demo.
git symbolic-ref --short HEAD ^/dev/null
end
# Async prompt setup.
#set async_prompt_functions _git_branch_name
function fzf --wraps=fzf --description="Use fzf-tmux if in tmux session"
if set --query TMUX
fzf-tmux $argv
else
command fzf $argv
end
end
#/opt/homebrew/Cellar/starship/1.11.0/bin/./starship init fish | source
#base16_tomorrow_night_eighties
# pnpm
set -gx PNPM_HOME "/Users/*****/Library/pnpm"
set -gx PATH "$PNPM_HOME" $PATH
# pnpm end
# retrieve command cheat sheets from cheat.sh
# fish version by @tobiasreischmann
function cheat.sh
curl cheat.sh/$argv
end
# register completions (on-the-fly, non-cached, because the actual command won't be cached anyway
complete -c cheat.sh -xa '(curl -s cheat.sh/:list)'
if status is-interactive
printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "fish"}}\x9c'
end
set -gx AWS_PROFILE (aws configure get profile)
function kubectl
kubecolor $argv
end
# Setting PATH for Python 3.12
# The original version is saved in /Users/****/.config/fish/config.fish.pysave
set -x PATH "/Library/Frameworks/Python.framework/Versions/3.12/bin" "$PATH"
**zoxide init --cmd cd fish | source**
What do you mean by doesn't replace the cd command?
I have the same problem. Adding zoxide init fish | source to the end of fish config file works fine. However, zoxide init --cmd cd fish | source doesn't add zoxide to fish.
However,
zoxide init --cmd cd fish | sourcedoesn't add zoxide to fish.
I've still not fully understood - what do you mean by "zoxide is not added to fish"? Also, what is your fish version / zoxide version?
I have zoxide init --cmd cd fish | source in my fish config at ~/.config/fish/config.fish when I launch a new terminal and run which cd I get /usr/bin/cd
If I run zoxide init --cmd cd fish | source in a terminal I get the same result.
Running alias I do get the following results
alias cd __zoxide_z
alias cdi __zoxide_zi
And when I try to use zoxide as described it does work
For example cd code will take me to ~/dev/code from the home directory
On MacOS 14.2.1, Fish v3.7.0, zoxide 0.9.4
@andyw134 the which command locates binaries with a given name, whereas zoxide defines cd as a function. Is there any issue you're having with the setup?
No issues, but I initially thought it was not working. Was contributing my experience in case it would help others.
Thank you, I had the exact same setup and too thought that because which cd returned /usr/bin/cd it wouldn't work. I know now that it does. Thanks for sharing 👍
Cool cool, closing this issue.