iTerm2安装与美化

所属分类:荐软件 | 发布于 2023-07-04 16:18:03

Mac系统自带的Terminal不太好看,一般会使用iTerm2+oh-my-zsh来替代系统自带的terminal

iTerm2官网:

https://iterm2.com/

iTerm2安装:

直接在官网点击Download下载,下载过来是一个zip包,解压后得到一个iTerm的应用程序,把它拖到Applications应用程序目录即完成安装。

使用oh-my-zsh美化iTerm2

Oh My Zsh is an open source, community-driven framework for managing your zsh configuration.

oh-my-zsh是一款开源的,社区驱动的管理zsh命令行配置的工具。使用它可以美化iTerm2

美化之前效果:

美化之后效果:

oh-my-zsh官网:

https://github.com/ohmyzsh/ohmyzsh

oh-my-zsh安装:

使用curl自动安装

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

使用wget自动安装

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

使用fetch自动安装

sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

手动安装

wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh

注意:我的电脑上wget和curl都不能访问https,所以直接在浏览器打开

https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh,然后本地新建一个shell文件zsh_install.sh,把内容复制到文件里,然后再执行shell脚本进行安装。

安装完成后提示信息:

Found /Users/alan/.zshrc. Backing up to /Users/alan/.zshrc.pre-oh-my-zsh
Using the Oh My Zsh template file and adding it to /Users/alan/.zshrc.

         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/                       ....is now installed!


Before you scream Oh My Zsh! look over the `.zshrc` file to select plugins, themes, and options.

• Follow us on Twitter: @ohmyzsh
• Join our Discord community: Discord server
• Get stickers, t-shirts, coffee mugs and more: Planet Argon Shop

oh-my-zsh注意事项

安装完成后会将原来的~/.zshrc替换成oh-my-zsh的模板,原来的~/.zshrc会被重命名成~/.zshrc.pre-oh-my-zsh

选择喜欢的主题

oh-my-zsh主题存放在~/.oh-my-zsh/themes/目录。

浏览所有oh-my-zsh主题:https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

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
# If you come from bash you might have to change your $PATH.
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
# If you come from bash you might have to change your $PATH.
jreese.zsh-theme               wuffers.zsh-theme
jtriley.zsh-theme              xiong-chiamiov-plus.zsh-theme
juanghurtado.zsh-theme         xiong-chiamiov.zsh-theme
# If you come from bash you might have to change your $PATH.
junkfood.zsh-theme             ys.zsh-theme
kafeitu.zsh-theme              zhann.zsh-theme

在~/.zshrc文件,可以修改主题

ZSH_THEME="robbyrussell"

可以看到默认的主题是robbyrussell。

~/.oh-my-zsh/themes目录下可以看到所有的主题,我们将主题改为random试试

ZSH_THEME="random"

执行source命令刷新环境变量

source ~/.zshrc

random主题效果如下

mira主题效果

mlh主题效果

candy主题效果

muse主题效果

wezm+主题效果

 

关闭iTerm2的提示弹窗

iTerm2默认会每天弹窗这个弹窗

可以在设置的Advanced选项卡里搜索tip,找到Tip of the Day,更改为yes,即可关闭每日提醒

 

文哥博客(https://wenge365.com)属于文野个人博客,欢迎浏览使用

联系方式:qq:52292959 邮箱:52292959@qq.com

备案号:粤ICP备18108585号 友情链接