前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >oh-my-zsh

oh-my-zsh

原创
作者头像
kwan的解忧杂货铺
发布2024-08-09 00:45:20
840
发布2024-08-09 00:45:20
举报
文章被收录于专栏:基础

一.安装软件

1.安装 1

代码语言:shell
复制
yum -y install zsh

2.安装 2

代码语言:shell
复制
#下载oh-my-zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

#移动文件
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

3.快捷命令

代码语言:shell
复制
#编辑
vim ~/.zshrc

#生效
source ~/.zshrc

alias cdtmp='cd `mktemp -d /tmp/sorrycc-XXXXXX`'
alias ip="ipconfig getifaddr en0 && ipconfig getifaddr en1"
alias hosts="vi /etc/hosts"

function mcd {
  mkdir $1 && cd $1;
}

二.配置主题

1.查看所有主题

代码语言:shell
复制
ls ~/.oh-my-zsh/themes
代码语言:apl
复制
3den.zsh-theme                 kardan.zsh-theme
Soliah.zsh-theme               kennethreitz.zsh-theme
adben.zsh-theme                kiwi.zsh-theme
af-magic.zsh-theme             kolo.zsh-theme
afowler.zsh-theme              kphoen.zsh-theme
agnoster.zsh-theme             lambda.zsh-theme
alanpeabody.zsh-theme          linuxonly.zsh-theme
amuse.zsh-theme                lukerandall.zsh-theme
apple.zsh-theme                macovsky-ruby.zsh-theme
arrow.zsh-theme                macovsky.zsh-theme
aussiegeek.zsh-theme           maran.zsh-theme
avit.zsh-theme                 mgutz.zsh-theme
awesomepanda.zsh-theme         mh.zsh-theme
bira.zsh-theme                 michelebologna.zsh-theme
blinks.zsh-theme               mikeh.zsh-theme
bureau.zsh-theme               miloshadzic.zsh-theme
candy-kingdom.zsh-theme        minimal.zsh-theme
candy.zsh-theme                mira.zsh-theme
clean.zsh-theme                mlh.zsh-theme
cloud.zsh-theme                mortalscumbag.zsh-theme
crcandy.zsh-theme              mrtazz.zsh-theme
crunch.zsh-theme               murilasso.zsh-theme
cypher.zsh-theme               muse.zsh-theme
dallas.zsh-theme               nanotech.zsh-theme
darkblood.zsh-theme            nebirhos.zsh-theme
daveverwer.zsh-theme           nicoulaj.zsh-theme
dieter.zsh-theme               norm.zsh-theme
dogenpunk.zsh-theme            obraun.zsh-theme
dpoggi.zsh-theme               peepcode.zsh-theme
dst.zsh-theme                  philips.zsh-theme
dstufft.zsh-theme              pmcgee.zsh-theme
duellj.zsh-theme               pygmalion-virtualenv.zsh-theme
eastwood.zsh-theme             pygmalion.zsh-theme
edvardm.zsh-theme              random.zsh-theme
emotty.zsh-theme               re5et.zsh-theme
essembeh.zsh-theme             refined.zsh-theme
evan.zsh-theme                 rgm.zsh-theme
fino-time.zsh-theme            risto.zsh-theme
fino.zsh-theme                 rixius.zsh-theme
fishy.zsh-theme                rkj-repos.zsh-theme
flazz.zsh-theme                rkj.zsh-theme
fletcherm.zsh-theme            robbyrussell.zsh-theme
fox.zsh-theme                  sammy.zsh-theme
frisk.zsh-theme                simonoff.zsh-theme
frontcube.zsh-theme            simple.zsh-theme
funky.zsh-theme                skaro.zsh-theme
fwalch.zsh-theme               smt.zsh-theme
gallifrey.zsh-theme            sonicradish.zsh-theme
gallois.zsh-theme              sorin.zsh-theme
garyblessington.zsh-theme      sporty_256.zsh-theme
gentoo.zsh-theme               steeef.zsh-theme
geoffgarside.zsh-theme         strug.zsh-theme
gianu.zsh-theme                sunaku.zsh-theme
gnzh.zsh-theme                 sunrise.zsh-theme
gozilla.zsh-theme              superjarin.zsh-theme
half-life.zsh-theme            suvash.zsh-theme
humza.zsh-theme                takashiyoshida.zsh-theme
imajes.zsh-theme               terminalparty.zsh-theme
intheloop.zsh-theme            theunraveler.zsh-theme
itchy.zsh-theme                tjkirch.zsh-theme
jaischeema.zsh-theme           tjkirch_mod.zsh-theme
jbergantine.zsh-theme          tonotdo.zsh-theme
jispwoso.zsh-theme             trapd00r.zsh-theme
jnrowe.zsh-theme               wedisagree.zsh-theme
jonathan.zsh-theme             wezm+.zsh-theme
josh.zsh-theme                 wezm.zsh-theme
jreese.zsh-theme               wuffers.zsh-theme
jtriley.zsh-theme              xiong-chiamiov-plus.zsh-theme
juanghurtado.zsh-theme         xiong-chiamiov.zsh-theme
junkfood.zsh-theme             ys.zsh-theme
kafeitu.zsh-theme              zhann.zsh-theme

2.修改 zsh 主题

编辑文件:

代码语言:shell
复制
sudo vim ~/.zshrc

将 ZSH_THEME="" 修改为 random 可以每次开启终端都随机一个,就比较变态,完美解决选择困难症患者

代码语言:sql
复制
#好看的主题
[oh-my-zsh] Random theme 'sonicradish'
robbyrussell 默认
gnzh 好用
sonicradish
intheloop
gallois   待选
fox
itchy

生效

代码语言:shell
复制
source ~/.zshrc

3.结果展示

代码语言:shell
复制
主题:
robbyrussell
image-20240806101455444
image-20240806101455444

4.更新 zsh

代码语言:shell
复制
omz update

三.powerlevel10k

1.安装主题

代码语言:shell
复制
git clone https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/themes/powerlevel10k

2.查看主题

代码语言:shell
复制
ls ~/.oh-my-zsh/themes

3.设置主题

代码语言:shell
复制
# 配置文件
sudo vim ~/.zshrc

# 主题设置
ZSH_THEME="powerlevel10k/powerlevel10k".

# 生效
source ~/.zshrc

4.配置 p10k

根据提示下载字体,按照自己喜欢的风格配置就好

代码语言:shell
复制
p10k configure

5.效果图

image-20240808192713969
image-20240808192713969

6.vscode 图标异常

查看 item2 的字体,可以看到是 MesloLGS NF,配置到 vscode 中

image-20240808203949462
image-20240808203949462
image-20240808204034144
image-20240808204034144

四.配置插件

1.查看插件

代码语言:apl
复制
ls ~/.oh-my-zsh/plugins

2.配置插件

代码语言:apl
复制
# 配置文件
sudo vim ~/.zshrc

# 生效
source ~/.zshrc

3.安装的插件

代码语言:apl
复制
plugins=(
git
pip
sudo
thefuck
autojump
last-working-dir
zsh-autosuggestions
zsh-syntax-highlighting
)

4.安装插件

代码语言:apl
复制
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git  ~/.oh-my-zsh/plugins/zsh-syntax-highlighting

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一.安装软件
    • 1.安装 1
      • 2.安装 2
        • 3.快捷命令
        • 二.配置主题
          • 1.查看所有主题
            • 2.修改 zsh 主题
              • 3.结果展示
                • 4.更新 zsh
                • 三.powerlevel10k
                  • 1.安装主题
                    • 2.查看主题
                      • 3.设置主题
                        • 4.配置 p10k
                          • 5.效果图
                            • 6.vscode 图标异常
                            • 四.配置插件
                              • 1.查看插件
                                • 2.配置插件
                                  • 3.安装的插件
                                    • 4.安装插件
                                    领券
                                    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档