发布于 
loading

Windows & MacOS Terminal美化 & Git Commit Message

Windows Terminal 美化

2022-7-31已无需如此麻烦,请看此网站https://ohmyposh.dev/

设置好后,还需要在PowerShell_profile.ps1文件中添加以下代码(路径:C:\Users\Administrator\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1),以在Windows Terminal初始化时能用上主题。

1
2
3
4
5
6
oh-my-posh init pwsh --config $env:POSH_THEMES_PATH\agnoster.omp.json | Invoke-Expression

$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if(Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
  1. https://zhuanlan.zhihu.com/p/76436374(需要注意评论区的代码才能设置主题)
  2. https://sspai.com/post/63233 目前为止仅有 Hacker Nerd Font 适合 Windows Terminal,其它字体都无法显示图标。

macOS Terminal 美化

Powerline Font 字体

iTerm 2

zsh 替代 bashoh-my-zsh来源:http://lizhiqiang.me/mac_terminal/https://www.jianshu.com/p/e62948cdb472

macOS Terminal 导出的配置路径: Softwares\macOS\Coding

[Solarized Dark Higher Contrast(macOS Terminal setting backup)]

Git Commit Message 设置

如出现以下报错,则使用https://www.cnblogs.com/boyGdm/p/16497848.html此链接🔗中的方法

1
The config file at "C:\Users\Administrator\.czrc" contains invalid charset, expect utf8

conventional-changelog
conventional-changelog-cli
cz-conventional-emoji

commitizen / git-cz(优先选择 git-cz)

  1. https://segmentfault.com/a/1190000022276650 如果装不上commitizen,必然是 Windows11 出现了问题,需要重置系统…
  2. https://github.com/streamich/git-cz

并非需要安装 commitizen,而是需要安装 git-cz,才能使用 cz-conventional-emoji

带有 emoji 的 commit 所需 npm 包如下:

!https://secure2.wostatic.cn/static/nA2Fz7Kcs6RtBYYHPULHW3/image.png?auth_key=1680489524-tzamM4gkdd2QXz8rnMR4ZD-0-dcb1423166bd6e5724386aaf1b827671

1
2
3
cz-conventional-emoji 安装后,Windows & macOS 都需要输入以下 echo 命令

echo '{ "path": "cz-conventional-emoji" }' > ~/.czrc
1
2
3
还需要注意,Windows 下使用 PowerShell 执行上面👆 echo 命令时会出错,使用 Git Bash 或 CMD 替代,或自己手动新建 .czrc 文件(.czrc 文件📃路径 C:\Users\Administrator\)

内容为:{ "path": "cz-conventional-emoji" }。

目前所有终端、代码编辑器我都是用 Hack 字体,除了 win 的终端会出现无法显示 emoji 外,没有任何影响。

VSCode & Pycharm Terminal Font Setting, Windows & macOS

Hack (🥇)

macOS Terminal Font Setting

UbuntuMono Nerd Font (🥇)

Windows 10 Terminal Font Setting

MesloLGS Nerd Font (🥇)(Windows Terminal美化的网站说明文档里有字体的下载)


本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。

本站由 @Kolin Lee 创建,使用 Stellar 作为主题。