macos安装zsh, bin/zsh command not found

https://www.cnblogs.com/xuLessReigns/p/11005435.html

mac下安装autojump

brew install autojump

1,安装zsh,执行

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

备用

sh -c "$(curl -fsSL https://ghproxy.com/raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

2,将zsh设置为默认的shell:

chsh -s /bin/zsh

(重启shell)

3,查看当前默认是哪个shell(bash or zsh)

echo $SHELL

4,安装autojump(确保有brew)

brew install autojump

5,安装了zsh之后会默认有一个文件.zshrc,可以打开终端并且ls -a查看,使用vim .zshrc打开.zshrc

6,点击i编辑文件

(1).在文件中搜索“plugins=”,
如果有修改为:plugins=(git autojump);
如果没有就在文件第一行写plugins=(git autojump);

(2).然后在新的一行添加写:

[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

(3).然后在新的一行添加写:

alias code="'/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code'"
alias gs="git status "
alias gc="git add . && git commit -am "

(4).保存更改后的配置文件,并且:wq保存退出。

7,然后执行

source .zshrc

autojump就可以直接使用啦~

本文来自网络,不代表本站立场,转载请注明出处:万道一,Wonder One » macos安装zsh, bin/zsh command not found
莫要搞事情哦
你喜欢的人刚好也未喜欢你
张学友刘德华邓紫琪已关注
赞(0) 打赏

赏点小费吧客倌

微信扫一扫打赏