zsh使用小记

知乎上关于zsh亮点的文章,我是看了这个介绍才对zsh有了兴趣:为什么说 zsh 是 shell 中的极品?

安装过程

yum -y install git zsh

# 安装oh-my-zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

# 安装插件autojump

git clone git://github.com/joelthelion/autojump.git ~/.oh-my-zsh/custom/plugins/autojump
cd  ~/.oh-my-zsh/custom/plugins/autojump
./install.py

# 安装其他插件
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting

# 修改~/.zshrc
# 加到最后一行
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
# 启用插件
plugins=(
  git autojump zsh-completions zsh-autosuggestions zsh-syntax-highlighting
)
# 修改插件主题
ZSH_THEME="ys"

# 重新加载配置文件
source ~/.zshrc
autoload -U compinit && compinit

# 打开新的terminal, 验证新的插件功能是否已经生效

zsh的插件列表:
awesome-zsh-plugins
oh-my-zsh Plugins Overview

另外记录两个其他的命令

# 修改时区
echo "export TZ='Asia/Shanghai'" >> /etc/profile
source /etc/profile

# 查看历史操作,去重
history | awk '{$1=""; print $0;}' | uniq

Comments are closed.