功能与特性
-
grep + 上下键 可以搜索grep最近的命令
-
智能纠错拼写
-
各种补全:路径补全、命令补全、命令参数补全、插件内容补全,补全的快捷键可以使用ctrl + n/p/f/b,反正没事多按tab键
-
配合autojump智能跳转,常用的指令如下
-
j foo 跳转到最精确匹配的foo的目录
-
d 可以查看最近的目录列表,根据列出的序号,直接输入序号即可进行快速跳转
-
.. 父级目录 ...祖父级的目录
mac 安装与配置
- chsh -s /bin/zsh 修改系统使用默认的zsh
- wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh 安装 oh my zsh
- 配置zsh
- brew install autojump 安装autojump
- 增加alias
# customed
#PROMPT='[%{$fg_bold[red]%}%n@%{$fg_bold[green]%}%m %{$fg[cyan]%}%d %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}] '
PROMPT='[%{$fg_bold[red]%}%n %{$fg[cyan]%}%d %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}] '
. /etc/profile
. ~/.cdz_bashrc
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i
export PATH=/Users/cdz/bin:$PATH
# pyenv
#export PYENV_ROOT="/usr/local/Cellar/pyenv/1.0.10"
#export PATH="$PYENV_ROOT/bin:$PATH"
#eval "$(pyenv init -)"
# develop
alias bp='bpython'
alias p='bpython'
# docker
alias d='docker'
alias dc='docker-compose'
alias dm='docker-machine'
# system
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='egrep --color=auto'
alias l='ls -G'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls -G'
alias psp='ps -aef | egrep "scrapy|UID" | grep -v grep'
alias net='netstat -anp tcp'
alias vi='vim'
alias tczf='tar -zcvf'
alias txzf='tar -zxvf'
# git
alias g='git'
alias gs='git status'
alias gck='git checkout'
alias grs='git resert'
alias gs='git status'
alias gcm='git commit'
alias gmr='git merge'
alias ga='git add'
alias gb='git branch'
alias grmt='git remote'
alias gphm='git push origin master'
alias gphd='git push origin dev'
alias gplm='git pull --rebase origin master'
alias gpld='git pull --rebase origin dev'
alias gt='git tag'
alias gpt='git push origin --tag'
# vpn
alias sslocal='sslocal -c /Users/cdz/etc/shadowsocks/shadowsocks.json'
alias privoxy='cd /usr/local/etc/privoxy; privoxy; cd -'
# weekly-text
alias week='cd /Users/cdz/code/weekly-data-inf/陈德智'
# other
alias aria='/Users/cdz/bin/aria2-1.31.0/aria2c --conf-path=/Users/cdz/bin/aria2-1.31.0/aria2.conf'
# brew
export PATH=/usr/local/bin:/usr/local/sbin:$PATH:.
# mysql
PATH=$PATH:/Applications/XAMPP/xamppfiles/bin
export PATH
# groovy
export GROOVY_HOME=/usr/local/opt/groovy/libexec
# gradle
export GRADLE_HOME=/usr/local/Cellar/gradle/3.5/libexec
# supervisord
alias spvd='supervisord -n'
alias spvc='supervisorctl'
alias degg='python setup.py mtclean mtbdist_egg --env=dev'
alias tegg='python setup.py mtclean mtbdist_egg --env=test'
alias pegg='python setup.py mtclean mtbdist_egg --env=prod'
alias rm='echo please check, backup and mv'
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i
export r_h='root@124.243.219.212::data_dev_upload/'
export r_h_pac='124.243.219.212::data_update_package/'
#rsync -av ${local_path} root@124.243.219.212::data_dev_upload/
-
修改主题: ZSH_THEME="macovsky-ruby" 主题所在的目录: ~/.oh-my-zsh/themes
-
配置插件: plugins=(git osx autojump)
命令行prompt提示
export PS1="%n@%m:%c
linux
install
- oh my zsh: https://ohmyz.sh/
- autojump:
yum -y install autojump-zsh
or https://github.com/wting/autojump#installation
网友评论