# This is the configuration file for Ghostty. # # This template file has been automatically created at the following # path since Ghostty couldn't find any existing config files on your system: # # /Users/sue/Library/Application Support/com.mitchellh.ghostty/config # # The template does not set any default options, since Ghostty ships # with sensible defaults for all options. Users should only need to set # options that they want to change from the default. # # Run `ghostty +show-config --default --docs` to view a list of # all available config options and their default values. # # Additionally, each config option is also explained in detail # on Ghostty's website, at https://ghostty.org/docs/config. # # Ghostty can reload the configuration while running by using the menu # options or the bound key (default: Command + Shift + comma on macOS and # Control + Shift + comma on other platforms). Not all config options can be # reloaded while running; some only apply to new windows and others may require # a full restart to take effect. # Config syntax crash course # ========================== # # The config file consists of simple key-value pairs, # # separated by equals signs. # font-family = Iosevka # window-padding-x = 2 # # # Spacing around the equals sign does not matter. # # All of these are identical: # key=value # key= value # key =value # key = value # # # Any line beginning with a # is a comment. It's not possible to put # # a comment after a config option, since it would be interpreted as a # # part of the value. For example, this will have a value of "#123abc": # background = #123abc # # # Empty values are used to reset config keys to default. # key = # # # Some config options have unique syntaxes for their value, # # which is explained in the docs for that config option. # # Just for example: # resize-overlay-duration = 4s 200ms #=========================== # ============================================ # Ghostty Terminal - Complete Configuration # ============================================ # File: ~/.config/ghostty/config # Reload: Cmd+Shift+, (macOS) # View options: ghostty +show-config --default --docs # --- Typography --- # 设置终端字体(支持 Nerd Font,适合图标) font-family = "Maple Mono Normal NF CN" #font-family = "等距更纱黑 SC Nerd Font" # 设置字体大小 font-size = 12 # 启用字体加粗/加厚(提高可读性) font-thicken = true # 调整行高(1 表示轻微增加) adjust-cell-height = 2 # --- Theme and Colors --- # Catppuccin with automatic light/dark switching # 设置主题 theme = 0x96f #theme = Catppuccin Mocha #theme = Ayu #theme = Apple System Colors # --- Window and Appearance --- # 设置背景透明度(0~1) background-opacity = 0.90 # 背景模糊半径(macOS 特效) background-blur-radius = 30 # macOS 标题栏样式(透明) macos-titlebar-style = transparent # 禁用窗口按步进缩放(更平滑) window-step-resize = false # 窗口左右内边距 window-padding-x = 10 # 窗口上下内边距 window-padding-y = 10 # 保存窗口状态(大小/位置) window-save-state = always # 窗口主题自动切换(跟随系统) window-theme = auto # --- Cursor --- # 光标样式(竖线) cursor-style = bar # 光标闪烁 cursor-style-blink = true # 光标透明度 cursor-opacity = 0.8 # --- Mouse --- # 输入时隐藏鼠标 mouse-hide-while-typing = true # 选中自动复制到剪贴板 copy-on-select = clipboard # --- Quick Terminal (Quake-style dropdown) --- # 下拉终端位置(顶部) quick-terminal-position = top # 在鼠标所在屏幕打开 quick-terminal-screen = mouse # 自动隐藏 quick-terminal-autohide = true # 动画时长(秒) quick-terminal-animation-duration = 0.15 # --- Security --- # 粘贴保护(防止误执行危险命令) clipboard-paste-protection = true # 安全 bracketed paste 模式 clipboard-paste-bracketed-safe = true # --- Shell Integration --- # 自动检测 shell(zsh/bash 等) shell-integration = detect # --- Keybindings --- # Tabs # 新建标签页 keybind = cmd+t=new_tab # 切换到左侧标签页 keybind = cmd+shift+left=previous_tab # 切换到右侧标签页 keybind = cmd+shift+right=next_tab # 关闭当前标签/窗口 keybind = cmd+w=close_surface # Splits # 向右分屏 keybind = cmd+d=new_split:right # 向下分屏 keybind = cmd+shift+d=new_split:down # 切换到左侧分屏 keybind = cmd+alt+left=goto_split:left # 切换到右侧分屏 keybind = cmd+alt+right=goto_split:right # 切换到上方分屏 keybind = cmd+alt+up=goto_split:top # 切换到下方分屏 keybind = cmd+alt+down=goto_split:bottom # Font size # 增大字体 keybind = cmd+plus=increase_font_size:1 # 减小字体 keybind = cmd+minus=decrease_font_size:1 # 重置字体大小 keybind = cmd+zero=reset_font_size # Quick terminal global hotkey # 全局快捷键:打开/关闭下拉终端 keybind = global:ctrl+grave_accent=toggle_quick_terminal # Splits management # 平均分配分屏大小 keybind = cmd+shift+e=equalize_splits # 最大化/还原当前分屏 keybind = cmd+shift+f=toggle_split_zoom # Reload config # 重新加载配置文件 keybind = cmd+shift+comma=reload_config # --- Performance --- # 滚动缓冲区大小(25MB,大约可回滚很多历史) scrollback-limit = 25000000 #避免root识别问题 term = xterm-256color