FauxFaux / zrs

faster 'z': jump to frecently used directories
MIT License
25 stars 1 forks source link

Instructions unclear #3

Open nikitavoloboev opened 4 years ago

nikitavoloboev commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago
❯ 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 commented 4 years ago

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 commented 4 years ago

It sources too much stuff :(

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