centos 7 安装zsh


yum install -y zshgit

image



cat /etc/shellsgithub

image



chsh -s /bin/zshshell


image



image

克隆当前session或者退出去再进来下session

image





安装oh my zshapp


国外主机能够直接安装ssh

via curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
via wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"


国内该域名被墙了,只能乖乖手动curl

git clone https://github.com/ohmyzsh/ohmyzsh.gitide

cd tools/url

./install.shspa


image

image


修改你喜欢的主题

vi ~/.zshrc

image


其余主题

ls /root/ohmyzsh/themes

image


我喜欢这主题

ZSH_THEME="bira"


image


配置了下快捷键

# Example aliases
alias zshconfig="vi ~/.zshrc"
alias zshconfigapply="source ~/.zshrc"
alias ohmyzsh="mate ~/.oh-my-zsh"
alias lll='ls -lrth'
alias sshmgmta=' ssh cust-cu-ch_lf-mgmt_a'
alias sshmgmtb=' ssh cust-cu-ch_lf-mgmt_b'

image



搞两个插件,历史命令提示和当前你命令高亮

git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting



image

image

编辑配置而且apply一下

image

image


稍微好看了一点

image

image


同时找历史命令也不用按ctrl+r ,直接打命令就能够了

image


git 插件

命令内容能够参考 cat ~/.oh-my-zsh/plugins/git/git.plugin.zsh。

经常使用的:



autojump 插件

https://github.com/wting/autojump

yum install –y autojump-zsh # CentOS

brew install autojump # Mac


zshconfig配置下

image

还要配置下

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh

相关文章
相关标签/搜索