本文基于 Windows 平台,系统用的是 WSL(ubuntu 20.04),shell 用的是 zsh,linux 系统应该类似

先看效果:
Windows Terminal:
Windows Terminal

VsCode:
vscode

oh-my-zsh

官方页面:https://ohmyz.sh/
github 地址:https://github.com/ohmyzsh/ohmyzsh

安装

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

配置

主题

我使用的是https://github.com/romkatv/powerlevel10k

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

常用命令:

命令 作用
p10k configure 重新配置 powerlevel10k
p10k help 查看帮助

插件

插件地址:https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins

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

修改配置 vim ~/.zshrc

1
2
3
4
plugins=(
git
zsh-autosuggestions
)

字体

建议使用带 emoji 的 poweline 字体, 推荐 Nert Fonts, 我用的是 jetbrains

关于等宽字体

顾名思义,等宽字体就是宽度相等的字体,举个例子:普通字体中 M 看体型就比 i 要宽,但是等宽字体中他俩是一样宽的,在编辑器中就可以对齐了

等宽字体一般文件名中带 Mono,如 JetBrains Mono,但是大部分等宽字体只对英文生效,中文字体和中文符号是不对齐的
想要中文也对齐的小伙伴可以使用这个字体:Ubuntu Mono derivative Powerline,此字体一个汉字和两个英文一样宽。再也不怕终端符号对不齐啦。

windows terminal 配置

改字体

“fontFace”: “JetBrainsMono NF”,

新版本的 Windows Terminal 可以有图形界面配置了

改配色

ayu 配色: https://github.com/ayu-theme/ayu-colors

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"background": "#0A0E14",
"black": "#01060E",
"blue": "#53BDFA",
"brightBlack": "#686868",
"brightBlue": "#59C2FF",
"brightCyan": "#95E6CB",
"brightGreen": "#C2D94C",
"brightPurple": "#FFEE99",
"brightRed": "#F07178",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFB454",
"cursorColor": "#FFFFFF",
"cyan": "#90E1C6",
"foreground": "#B3B1AD",
"green": "#91B362",
"name": "Ayu Dark",
"purple": "#FAE994",
"red": "#EA6C73",
"selectionBackground": "#FFFFFF",
"white": "#C7C7C7",
"yellow": "#F9AF4F"
},
{
"background": "#FAFAFA",
"black": "#000000",
"blue": "#3199E1",
"brightBlack": "#686868",
"brightBlue": "#399EE6",
"brightCyan": "#4CBF99",
"brightGreen": "#86B300",
"brightPurple": "#A37ACC",
"brightRed": "#F07171",
"brightWhite": "#D1D1D1",
"brightYellow": "#F2AE49",
"cursorColor": "#FFFFFF",
"cyan": "#46BA94",
"foreground": "#6C7680",
"green": "#99BF4D",
"name": "Ayu Light",
"purple": "#9E75C7",
"red": "#EA6C6D",
"selectionBackground": "#FFFFFF",
"white": "#C7C7C7",
"yellow": "#ECA944"
},
{
"background": "#1F2430",
"black": "#191E2A",
"blue": "#6DCBFA",
"brightBlack": "#686868",
"brightBlue": "#73D0FF",
"brightCyan": "#95E6CB",
"brightGreen": "#BAE67E",
"brightPurple": "#D4BFFF",
"brightRed": "#F28779",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFD580",
"cursorColor": "#FFFFFF",
"cyan": "#90E1C6",
"foreground": "#CBCCC6",
"green": "#A6CC70",
"name": "Ayu Mirage",
"purple": "#CFBAFA",
"red": "#ED8274",
"selectionBackground": "#FFFFFF",
"white": "#C7C7C7",
"yellow": "#FAD07B"
},

透明背景

首先来个背景图:
背景图

设置背景图像路径
背景图像的不透明度:70
启用 acrylic
acrylic 不透明度:1

vscode 配置

设置➡️控制字体系列 (editor.fontFamily)➡️在最前面添加 'MeslolGS NF',

vscode配置

ubuntu 自带 terminal 配置

系统目录和用户目录二选一

  • 安装字体 (系统目录)

    1
    2
    3
    4
    5
    6
    sudo mkdir -p /usr/share/fonts/custom
    sudo mv *.ttf /usr/share/fonts/custom

    sudo mkfontscale
    sudo mkfontdir
    sudo fc-cache -fv
  • 安装字体(用户目录)

    1
    mv *.ttf ~/.local/share/fonts

terminal 设置

自定义字体勾选,然后选择字体即可