Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.08 KB

zsh.md

File metadata and controls

47 lines (36 loc) · 1.08 KB

zsh

install

# centos
sudo yum install zsh
# ubuntu
sudo apt-get install zsh
zsh:chsh -s /bin/zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
#or
git clone --depth=1 git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

config

~/.zshrc

plugins=(ubuntu git command-not-found common-aliases kubectl tmux zsh-wakatime)

alias cls='clear'
alias dig='dig +nocookie'

alias grep="grep --color=auto"
alias -s html=mate   # 在命令行直接输入后缀为 html 的文件名,会在 TextMate 中打开
alias -s rb=mate     # 在命令行直接输入 ruby 文件,会在 TextMate 中打开
alias -s py=vi       # 在命令行直接输入 python 文件,会用 vim 中打开,以下类似
alias -s js=vi
alias -s yaml=vi
alias -s txt=vi
alias -s gz='tar -xzvf'
alias -s tgz='tar -xzvf'
alias -s zip='unzip'
alias -s bz2='tar -xjvf'

export TIME_STYLE='+%Y/%m/%d %H:%M:%S'

启动和关机文件的处理顺序

.zshenv → .zprofile → .zshrc → .zlogin → .zlogout