终端工具配置

文章目录

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
相关推荐
szarron11 分钟前
RF Demo Kit|NanoVNA 射频演示测试板完整上手教程,滤波器、衰减器、SOLT 校准学习板
开发语言·人工智能·学习·php·射频工程·频谱仪
边境悍匪22 分钟前
蜗牛学苑 Java 智能体学习 Day39|SpringAI 会话存储、Function‑Call 工具调用、MCP 思维导图复盘
java·开发语言·spring boot·学习·阿里云
万物智能信息科技36 分钟前
RK3568 的多路显示移植—【万物智能之开源鸿蒙OpenHarmony系统实战开发系列教程】
linux·开发语言·华为·开源·harmonyos
蓝悦无人机1 小时前
Qt Design Studio(QDS)4.8.2项目文件结构详解
开发语言·qt·qt creator·qds·项目文件结构·qtc
yxlalm1 小时前
4.java秒杀项目第四课-后端商品后台接口
java·开发语言
孙启超1 小时前
【AI开发之Rust】第 1 课:认识 Rust 与开发环境 —— 装好工具链,跑通第一个程序
开发语言·人工智能·后端·ai·rust·安全架构
君顾11 小时前
家政派单小程序源码开发实战:从零搭建到上线全流程指南
java·开发语言·家政派单
深念Y2 小时前
iOS模拟器在无Metal的NVIDIA显卡环境下的可行性研究报告
服务器·ios·unix·pve·freebsd
2501_915909062 小时前
SwiftUI 和 UIKit 怎么选?两代 UI 框架的适用范围
vscode·ios·objective-c·个人开发·swift·敏捷流程
我是唐青枫3 小时前
C#.NET PInvoke 深入解析:封送、内存布局与原生互操作实战
开发语言·c#·.net