美文网首页
zsh安装介绍

zsh安装介绍

作者: 河水中的瓶 | 来源:发表于2020-01-30 10:26 被阅读0次

1.安装zsh

sudo apt-get install zsh

2、把默认的Shell改成zsh

chsh -s /bin/zsh

3.查看文件是否改正

sudo vim /etc/passwd

4.安装git

sudo apt-get install git

5.安装curl

sudo apt-get install curl

6.安装oh-my-zsh

命令参考官网地址: https://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

或者

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

7.安装autojump自动跳转插件

官网:https://github.com/wting/autojump

安装:

sudo apt-get install autojump

配置:

vim .zshrc
#在最后一行加入,注意点后面是一个空格
. /usr/share/autojump/autojump.sh

8.安装zsh-syntax-highlighting语法高亮插件

官网:https://github.com/zsh-users/zsh-syntax-highlighting

安装:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
#配置命令如下
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

Then, enable syntax highlighting in the current interactive shell:

source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

9、安装zsh-autosuggestions语法历史记录插件

官网:https://github.com/zsh-users/zsh-autosuggestions

安装:

git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

10、配置主题

官方主题参考:https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes

https://github.com/ohmyzsh/ohmyzsh/wiki/themes

sudo vim ~/.zshrc

找到ZSH_THEME="robbyrussell",修改为:ZSH_THEME="ys";

生效:

source ~/.zshrc

Tips: 终端的颜色需要自己设置,主题的更换只有样式

image.png

相关文章

网友评论

      本文标题:zsh安装介绍

      本文链接:https://www.haomeiwen.com/subject/tukithtx.html