Wsl-终端美化
使用到的是oh-my-zsh
感觉这个上手还是比较快的。
参考的教程:
使用 Oh My Zsh 主题和插件自定义您的终端
zsh 安装与配置,使用 oh-my-zsh 美化终端 | Leehow的小站
主题预览:
oh-my-zsh 主题样式列表 | 计算机科学论坛
官网:(也有安装教程)
Oh My Zsh - a delightful & open source framework for Zsh
安装主题前,需要安装 ZSH
1 | |
验证安装结果:
1 | |
将其设置为默认shell(注意不要使用sudo)
1 | |
接着开始安装oh my zsh
任选一个进行安装:
| Method | Command |
|---|---|
| curl | sh -c "$(curl -fsSL https://install.ohmyz.sh/)" |
| wget | sh -c "$(wget -O- https://install.ohmyz.sh/)" |
| fetch | sh -c "$(fetch -o - https://install.ohmyz.sh/)" |
| 国内curl镜像 | sh -c "$(curl -fsSL https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)" |
| 国内wget镜像 | sh -c "$(wget -O- https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)" |
安装好之后我们可以加入一些插件
添加插件的方法:
- 手动安装
- 将插件名添加到
.zshrc里
1 | |
插件配置和更新
1 | |
对于内置插件,使用oh my zsh的更新机制:
1 | |
如果您的 shell 变慢,监控插件加载时间:
1 | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
1 | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
1 | |
cp ~/.oh-my-zsh/themes/robbyrussell.zsh-theme ~/.oh-my-zsh/custom/themes/mytheme.zsh-theme
1 | |
PROMPT=’%{$fg[cyan]%}%n%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %# ‘
ZSH_THEME_GIT_PROMPT_PREFIX=” git:(%{$fg[red]%}”
ZSH_THEME_GIT_PROMPT_SUFFIX=”%{$reset_color%}”
ZSH_THEME_GIT_PROMPT_DIRTY=”%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}”
ZSH_THEME_GIT_PROMPT_CLEAN=”%{$fg[blue]%})”
1 | |
ZSH_THEME=”mytheme”