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

相關文章
相關標籤/搜索