终端工具配置

文章目录

Ghoustty

安装

shell 复制代码
brew install --cask ghostty

配置文件

shell 复制代码
# ============================================
# Ghostty Terminal - Complete Configuration
# ============================================

# --- Typography ---
font-family = "Maple Mono NF CN"
font-size = 15
font-thicken = true
adjust-cell-height = 6

# --- Theme and Colors ---
theme = Kanagawa Wave

# --- Window and Appearance ---
background-opacity = 0.8
macos-titlebar-style = transparent
window-padding-x = 16
window-padding-y = 4
window-save-state = never
window-width = 125
window-height = 31
window-theme = auto

# --- Cursor ---
cursor-style = bar
cursor-style-blink = true

# --- 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

# --- Close behavior ---
confirm-close-surface = false

# --- Security ---
clipboard-paste-protection = true
clipboard-paste-bracketed-safe = true

# --- Shell Integration ---
shell-integration = detect
shell-integration-features = cursor,sudo,no-title,ssh-env,ssh-terminfo,path

# --- 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 ---
scrollback-limit = 25000000

修复远程服务器bug

需要在~/.ssh/config中设置好远程服务器样式

shell 复制代码

starship

安装

shell 复制代码
brew instapp starship

或者

shell 复制代码
curl -sS https://starship.rs/install.sh | sh

~/.config/starship.toml配置

https://raw.githubusercontent.com/cradiator/dotfiles/refs/heads/main/.config/starship.toml

~/.zshrc 或者 ~/.bashrc

shell 复制代码
eval "$(starship init zsh)"
shell 复制代码
eval "$(starship init bash)"

source加载配置文件

TMUX

~/.tmux.conf配置

shell 复制代码
vim ~/.tmux.conf

粘贴

shell 复制代码
# =========================
# 基础设置
# =========================

# 修改前缀键 (默认是 Ctrl+b)
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# 启用鼠标支持
set -g mouse on

# 更快的响应
set -sg escape-time 0

# 终端颜色
set -g default-terminal "xterm-256color"

# =========================
# 窗口和面板
# =========================

# 使用 | 和 - 分割窗口
bind | split-window -h
bind - split-window -v

unbind '"'
unbind %

# 使用 vim 风格移动 pane
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# 调整 pane 大小
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5

# 重新加载配置
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"

# =========================
# 窗口操作
# =========================

# 更容易切换窗口
bind -n C-Left previous-window
bind -n C-Right next-window

# 快速新窗口
bind c new-window -c "#{pane_current_path}"

# 新pane继承路径
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"

# =========================
# 复制模式 (更像vim)
# =========================

setw -g mode-keys vi

# 进入复制模式
bind Enter copy-mode

# 复制快捷键
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel

# =========================
# 状态栏
# =========================

set -g status-bg colour235
set -g status-fg white

set -g status-left-length 50
set -g status-right-length 100

# 左侧
set -g status-left "#[fg=green]#S "

# 右侧
set -g status-right "#[fg=yellow]#(whoami) #[fg=cyan]%Y-%m-%d %H:%M "

# =========================
# 窗口样式
# =========================

setw -g window-status-current-style fg=black,bg=green
setw -g window-status-style fg=white,bg=colour235

# =========================
# 历史记录
# =========================

set -g history-limit 100000

# =========================
# 快速清屏
# =========================

bind C-l send-keys 'C-l'

# =========================
# 自动重命名
# =========================

set-option -g allow-rename off

加载配置文件

shell 复制代码
tmux source ~/.tmux.conf
相关推荐
全速向光14 分钟前
用 Three.js 从零打造一棵会发光的 3D 圣诞树
开发语言·javascript·3d
codeejun21 分钟前
每日一Go·MySQL-28、账户转账事务设计
开发语言·mysql·golang
ShineWinsu38 分钟前
对于Qt:QSS样式属性的解析
开发语言·c++·qt·面试·盒子模型·客户端·qss
reasonsummer1 小时前
【办公类-178-01】20261204医保需要“幼儿园园通学籍证明截图”(Python页面截图+转PDF)
开发语言·c#
夜雪轻寒1 小时前
AI 工具踩坑录:Prompt 我越写越长,模型反而越来越笨,删到第三版才明白它在装
java·开发语言·人工智能·语言模型·自然语言处理·prompt
吴名氏.1 小时前
全栈跃迁:Java 后端 27 讲【7】MyBatisPlus进阶与慢SQL治理
java·开发语言·数据库·sql·大模型·sql调优
『 时光荏苒 』2 小时前
SQL 中常用的查询条件分类汇总,每个都配有“大白话注释”和示例,方便你对照学习
android·java·开发语言
王者鳜錸2 小时前
【中英】-Android离线语音听写-讯飞 AIKit源码实现
开发语言·python·智能手机·安卓·离线中英识别
nice_lcj5202 小时前
Jakarta Validation:从注解到自定义约束的完整实践
java·开发语言·spring boot
ii_best2 小时前
按键精灵和触动精灵哪个好?iOS 自动化选型的四个判断维度
运维·ios·自动化·按键精灵