mac zsh oh-my-zsh

安装zhh教程Installing ZSH · ohmyzsh/ohmyzsh Wiki (github.com)

 

使用brew安装zsh

>brew install zsh zsh-completions

安装前最好搜索下

>brew search zsh

 

查询zsh是否安装成功to check out the version

>zsh --version

如成功,则会显示其版本号,本机zsh版本号5.8

 

查询zsh安装路径(由于本机是brew安装的,在这个目录下)

>echo $SHELL

to check out the install path

I just install zsh with brew,so the path is:/usr/local/bin/zsh-5.8

也许你的安装路径为

/usr/local/bin/zsh 

或者

/bin/zsh

who knows

 

将brew安装路径添加到系统shells中

>sudo vi /etc/shells

add line as:

/usr/local/bin/zsh-5.8

then change shell with zsh:

>chsh -s /usr/local/bin/zsh-5.8

如果不添加shells中的话会出现以下错误提示 else you will fine error hint like :

关键词为non-standard shell

solution:

macos - How to change the Login Shell on Mac OS X from bash to zsh? - Super User

 

next is how to install oh-my-zsh

first you should install the Powerline Fonts in order to render the themes properly

powerline/fonts: Patched fonts for Powerline users. (github.com)

quick installation:

# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts

uninstall:

Run ./uninstall.sh to uninstall all Powerline Fonts. You can also copy the quick installation commands changing only the line ./install.sh to ./uninstall.sh.

 

第二是安装oh-my-zsh

由于是网络的问题,无论是curl还是其他的方法都不行,只能使用manual方法

其实curl等方法无非就是将Install.sh执行里面的代码,所以直接git clone oh-my-zsh这个仓库

如果不要的话就直接删除了

>rm -rf ~/.oh-my-zsh

然后创建一个.zshrc文件,重新启动shell即可

 

posted on 2022-01-22 22:19  风中狂笑  阅读(202)  评论(0编辑  收藏  举报

导航