CentOS7安装ohmyzsh
前提:安装好Git
1、安装zsh并更改默认终端
安装软件包
1 | yum -y install zsh git |
更改默认终端
1 | chsh -s /bin/zsh |
2、配置oh-my-zsh
拉取oh-my-zsh
1 | git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh |
默认配置
1 | cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc |
3、安装高亮、自动补全插件
安装高亮插件:zsh-syntax-highlighting
1 | git clone https://gitee.com/dawnwords/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting |
安装自动补全:zsh-autosuggestions
1 | git clone https://gitee.com/lhaisu/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
安装autojump目录跳转
1 | git clone https://gitee.com/gentlecp/autojump.git |
4、插件配置
1 | vim ~/.zshrc |
1 | plugins=( |
1 | source ~/.zshrc |
5、修改主题
1 | vim ~/.zshrc |
个人比较喜欢这套
1 | ZSH_THEME="maran" |
除了自带的两个主题外我个人还比较喜欢两个
分别是sobole和jovial
sobole
jovial
sobole安装地址:
jovial安装地址:
dracula-theme安装地址
Dark theme for Zsh and 266+ apps — Dracula (draculatheme.com)
1 | source ~/.zshrc |
6、其他
zsh粘贴慢问题:一个字符一个字符粘贴。这是zsh的问题
解决:修改zsh配置:vim ~/.zshrc
,增加如下代码:
1 | vim ~/.zshrc |
1 | pasteinit() { |
1 | source ~/.zshrc |
LAST:效果展示
美化前:
美化后:
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 代码港湾!
评论