oh-my-zsh配置

Posted 星辰大海

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oh-my-zsh配置相关的知识,希望对你有一定的参考价值。

配置oh-my-zsh和主题

更改默认shell

chsh -s /usr/bin/zsh

配置oh-my-zsh

github hosts文件更改

sudo nano /etc/hosts

添加字段:

# GitHub Start
151.101.76.133 raw.githubusercontent.com
# GitHub End

下载oh-my-zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

安装高亮功能

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

安装自动补全功能

git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

修改配置文件,以启用功能

nano ~/.zshrc

插件改为:

plugins=(git zsh-syntax-highlighting zsh-autosuggestions sudo extract)

执行source ~/.zshrc

配置主题(Powerlevel-10k)

git命令克隆:

github:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

gitee:

git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

修改配置文件

nano ~/.zshrc

主题改为

ZSH_THEME="powerlevel10k/powerlevel10k"

想要启用主题中的图标,需要安装nerd字体

比如Arch-Linux中的nerd-fonts-hacknerd-fonts-source-code-pro

重启并按照步骤个性化设置

以上是关于oh-my-zsh配置的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7.5安装配置Oh-My-Zsh

Tool---ubuntu18.04配置oh-my-zsh工具

oh-my-zsh安装配置

ubuntu配置zsh和oh-my-zsh

安装 Zsh 及 Oh-my-zsh

Arch安装zsh以及通过 Oh-My-ZSH! 开源项目的配置