Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions unclear #3

Open
nikitavoloboev opened this issue Feb 8, 2020 · 4 comments
Open

Instructions unclear #3

nikitavoloboev opened this issue Feb 8, 2020 · 4 comments

Comments

@nikitavoloboev
Copy link

I installed the tool and have zrs in my path. I also ran zrs --add-to-profile and it added . '/Users/nikivi/Library/Application Support/zrs/z.sh' to my ~/.zshrc

Instructions make it sound that I can then run z bar to change to dirs but z is not part of my path.

What am I missing?

@FauxFaux
Copy link
Owner

FauxFaux commented Feb 8, 2020

z is a function, which is declared in that sourced file.

zsh's built-in which is smart enough to know:

faux@astoria:~% which z 
z: aliased to _z 2>&1
faux@astoria:~% which _z
_z () {
	local output ret
	output="$(zrs "$@")" 
...

z bar will do nothing if it can't find a directory (but will set an exit code).
z with no arguments will show the status of the database?

@nikitavoloboev
Copy link
Author

nikitavoloboev commented Feb 9, 2020

❯ which z
z not found

❯ which zrs
/Users/nikivi/.cargo/bin/zrs

❯ cat ~/.zshrc
source ~/.zsh_plugins.sh # Load zsh plugins
source ~/.dotfiles/zsh/env.zsh
source ~/.dotfiles/zsh/options.zsh
source ~/.dotfiles/zsh/functions/functions.zsh
source ~/.dotfiles/zsh/functions/fzf-functions.zsh
source ~/.dotfiles/zsh/functions/git-functions.zsh
source ~/.dotfiles/zsh/bindings.zsh
source ~/.dotfiles/zsh/alias.zsh

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh



. '/Users/nikivi/Library/Application Support/zrs/z.sh'

And that file does exist.

2020-02-09 at 13 07

@FauxFaux
Copy link
Owner

FauxFaux commented Feb 9, 2020

That looks reasonable to me. I have no idea what's going on there.

Try starting zsh with -x?

% zsh -x
...
+/home/faux/.zshrc:193> . /home/faux/.local/share/zrs/z.sh
+/home/faux/.local/share/zrs/z.sh:28> [ -d /home/faux/.z ']'
+/home/faux/.local/share/zrs/z.sh:61> alias 'z=_z 2>&1'
+/home/faux/.local/share/zrs/z.sh:63> [ '' ']'
+/home/faux/.local/share/zrs/z.sh:63> _Z_RESOLVE_SYMLINKS=-P 
+/home/faux/.local/share/zrs/z.sh:65> type compctl
+/home/faux/.local/share/zrs/z.sh:67> [ '' ']'
+/home/faux/.local/share/zrs/z.sh:69> [ '' ']'
+/home/faux/.local/share/zrs/z.sh:78> [[ -n '' ]]
+/home/faux/.local/share/zrs/z.sh:79> precmd_functions[$(($#precmd_functions+1))]=_z_precmd 
+/home/faux/.local/share/zrs/z.sh:88> compctl -U -K _z_zsh_tab_completion _z
...

Here I see it create the alias and the completion?

@nikitavoloboev
Copy link
Author

It sources too much stuff :(

I'll try to find the cause and dig into it more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants