终端工具配置

文章目录

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
相关推荐
不写八个2 小时前
PHP教程005:配置ThinkPHP环境
开发语言·php
迷海2 小时前
C++内存对齐
开发语言·c++
炘爚2 小时前
C++(流类:istream /ostream/istringstream /ostringstream)
开发语言·c++·算法
Gse0a362g2 小时前
推荐 PHP 属性(Attributes) 简洁读取 API 扩展包
android·开发语言·php
塞北山巅2 小时前
Windows 下基于 MSYS2 搭建 C++ 开发环境:从安装到配置全指南
开发语言·c++·windows
rOuN STAT2 小时前
PLC(电力载波通信)网络机制介绍
开发语言·网络·php
wjs20242 小时前
HTML 标签列表(功能排序)
开发语言
无尽的罚坐人生2 小时前
hot 100 146. LRU 缓存
java·开发语言·缓存