Alacritty 是一个现代终端模拟器,具有合理的默认设置,但允许进行广泛的配置。通过与其他应用程序集成,而不是重新实现它们的功能,它能够提供一套灵活的高性能特性。目前支持的平台包括 BSD、Linux、macOS 和 Windows。
如果不需要修改图标推荐直接下载
直接下载官网编译的安装包 https://alacritty.org/index.html
手动编译 这里因为源代码的图标是方形直角, 并且和 macOS 的图标风格不太搭配, 所以我自己 fork 了一份修改了图标, 所以需要手动编译
安装 rust 和 make 环境
bash# 安装 rust 环境, 如果已存在则可以跳过
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
brew install make
bash # 浅克隆仓库代码
git clone --depth 1 https://github.com/KevinYouu/alacritty.git
cd alacritty
# 编译当前架构
make dmg
# 编译 macOS 的通用架构
# dmg-universal
然后可以在 alacritty/target/release/osx
这个目录找到编译好的 app 和 dmg 文件, 直接放入 /Applications
即可使用
这是我的自定义配置文件
toml[window]
dimensions = { columns = 80, lines = 24 }
padding = { x = 4, y = 0 }
opacity = 0.2
blur = true
[font]
normal = { family = "Roboto Mono", style = "Regular" }
bold = { family = "Roboto Mono", style = "bold" }
italic = { family = "Roboto Mono", style = "italic" }
bold_italic = { family = "Roboto Mono", style = "bold italic" }
size = 18
[selection]
save_to_clipboard = true
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
[cursor]
style = { shape = "Beam", blinking = "On" }
[terminal]
shell = { program = "/opt/homebrew/bin/fish", args = ["-l"] }
[colors.primary]
foreground = "#ffffff" # 白色
background = "#000000" # 黑色
[colors.normal]
black = "#000000"
red = "#ff3b30"
green = "#4cd964"
yellow = "#ffcc00"
blue = "#007aff"
magenta = "#ff2d55"
cyan = "#5ac8fa"
white = "#ffffff"
[colors.bright]
black = "#686868"
red = "#ff3b30"
green = "#4cd964"
yellow = "#ffcc00"
blue = "#007aff"
magenta = "#ff2d55"
cyan = "#5ac8fa"
white = "#ffffff"
[keyboard]
bindings = [
# 复制 (Cmd + C)
{ key = "C", mods = "Command", action = "Copy" },
# 粘贴 (Cmd + V)
{ key = "V", mods = "Command", action = "Paste" },
# 查找 (Cmd + F)
{ key = "F", mods = "Command", action = "SearchForward" },
# 新建窗口 (Cmd + N)
{ key = "N", mods = "Command", action = "CreateNewWindow" },
# 缩小字体 (Cmd + -)
{ key = "Minus", mods = "Command", action = "DecreaseFontSize" },
# 放大字体 (Cmd + =)
{ key = "Equals", mods = "Command", action = "IncreaseFontSize" },
# 恢复默认字体大小 (Cmd + 0)
{ key = "Key0", mods = "Command", action = "ResetFontSize" },
# 切换全屏 (Cmd + Enter)
{ key = "Return", mods = "Command", action = "ToggleSimpleFullscreen" },
# 切换到具体标签页 (Cmd + 1 ~ Cmd + 9)
{ key = "Key1", mods = "Command", action = "SelectTab1" },
{ key = "Key2", mods = "Command", action = "SelectTab2" },
{ key = "Key3", mods = "Command", action = "SelectTab3" },
{ key = "Key4", mods = "Command", action = "SelectTab4" },
{ key = "Key5", mods = "Command", action = "SelectTab5" },
{ key = "Key6", mods = "Command", action = "SelectTab6" },
{ key = "Key7", mods = "Command", action = "SelectTab7" },
{ key = "Key8", mods = "Command", action = "SelectTab8" },
{ key = "Key9", mods = "Command", action = "SelectTab9" },
# 隐藏 Alacritty (Cmd + H)
{ key = "H", mods = "Command", action = "Hide" },
# 隐藏其他应用 (Cmd + Option + H)
{ key = "H", mods = "Command|Option", action = "HideOtherApplications" },
]