0
点赞
收藏
分享

微信扫一扫

zsh美化

树下的老石头 2021-09-21 阅读 110

目录:

1.安装zsh;

2.安装oh-my-zsh;

3.oh-my-zsh主题切换;

4.安装插件;


安装zsh

#安装zsh

sudopacman-Szsh

#查看安装的zsh版本

zsh--version

#切换zsh

#终端设置->编辑当前方案,将命令改为/bin/zsh

chsh-s/bin/zsh

#验证是否替换成功

echo $SHELL

安装oh-my-zsh

#安装oh-my-zsh

方法一curl:

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

方法二wget:

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

方法三 手动下载安装:

## 下载源码

git clone https://github.com/robbyrussell/oh-my-zsh

## 执行安装命令

cd oh-my-zsh/tools

sh install.sh


oh-my-zsh主题切换

# 1. 进入home目录,修改配置文件主题

vim ~/.zshrc

# 2. 修改如下内容

ZSH_THEME="agnoster"

# 3. 修改完之后需要重新加载

source ~/.zshrc

# 4. 下载主题需要的字体。不然终端的是乱码的

git clone https://github.com/supermarin/powerline-fonts.git

# 5. 通过finder进入到这个目录

安装Menlo RegularforPowerline.otf和MonacoforPowerline.otf两个字体

# 6. 然后通过终端的设置字体为上述的两种的其中一种就可以。

主题powerline

[ZSH安装超酷的powerlevel9k主题]http://mimosa-pudica.net/src/incr-0.2.zsh将插件放在 oh-my-zsh 自定义插件目录中~/.oh-my-zsh/custom/plugins/incr

在~/.zshrc文件中的plugins字段中添加incr,同时在这个文件的结尾处添加

source $ZSH/custom/plugins/incr/incr*.zsh

更新配置

source ~/.zshrc

zsh-syntax-highlighting:高亮

下载zsh-syntax-highlighting

gitclone https://github.com/zsh-users/zsh-syntax-highlighting.git${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

修改配置~/.zshrc

plugins=(zsh-syntax-highlighting)

zsh-autosuggestions:输入命令行时自动补全

下载zsh-autosuggestions

git clone git://github.com/zsh-users/zsh-autosuggestions$ZSH_CUSTOM/plugins/zsh-autosuggestions

修改配置~/.zshrc

plugins=(zsh-autosuggestions)

举报

相关推荐

0 条评论