14

iterm2 ohmyzsh

In 'zsh' I can't use 'z' to search folders, appears command not found: z

I try to run

source "$(brew --prefix)/etc/profile.d/z.sh"

and

source /usr/local/etc/profile.d/z.sh

but doesn't work

2 Answers2

26

I got it!,

First:

vim ~/.zshrc

and

plugins=(
    git
    z
)

exit with :x!

And run

source ~/.zshrc
  • This did not solve it for me. I am using zprezto and added it after the initialization of zprezto, so might have to do with that... – titusn May 20 '19 at 19:08
  • 1
    However I was able to solve it using this nice answer: https://superuser.com/a/998871/169461 – titusn May 20 '19 at 19:18
  • 2
    In order to have it work right away you want to issue a `source ~/.zshrc` command – Muc Sep 26 '19 at 16:58
0

Another possibility,unalias -a is put below source /path/to/z.sh or source /path/to/oh-my-zsh.sh, because z is an alias for _z

$ type z
z is an alias for _z 2>&1

so, remove unalias -a (or comment this line )

or put it above source /path/to/oh-my-zsh.sh(or source /path/to/z.sh). eg:

unalias -a
source $ZSH/oh-my-zsh.sh

or add source $ZSH/oh-my-zsh.sh at the end of .zshrc file.

levinit
  • 394
  • 3
  • 7