0%

oh-my-zsh安装

目录

[TOC]

安装zsh

1
2
# 安装zsh
yum install zsh
1
2
3
4
# 设置默认shell为zsh
chsh -s $(which zsh)
# 切换为bash
chsh -s /bin/bash
1
2
# 检查设置是否成功
echo $SHELL
1
2
# 检查是否安装了zsh(安装oh-my-zsh之前必须安装zsh)
zsh --version
1
2
# 安装oh-my-zsh(wget)
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
1
vim ~/.zshrc

设置主题

1
2
3
4
5
6
7
# 默认主题
ZSH_THEME="robbyrussel"
# mira agnoster duellj(推荐的主题)
# 设置随机主题
ZSH_THEME="random"
# oh-my-zsh默认自带的主题放置的位置
vim ~/.oh-my-zsh/themes

安装插件

1
2
# 安装语法高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
1
2
# 安装自动补全插件
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
1
2
# 在~/.zshrc中配置插件
plugins=(git wd web-search history history-substring-search zsh-syntax-highlighting zsh-autosuggestions)
1
2
# 重新加载配置即可
source ~/.zshrc

欢迎关注我的其它发布渠道