终端工具配置

文章目录

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
相关推荐
starzy19909 分钟前
深入理解Scala隐式值:编译期自动装配
开发语言·后端·scala
布莱克60527 分钟前
Swift 条件语句详解:从 if 到 switch 的完整指南
开发语言·ssh·swift·switch·条件语句·guard·if
茶底世界之下38 分钟前
舞台灯下的萨克斯:用 Awaking 让铜管从蓝幕前亮起来
ios·app·产品
吴可可12342 分钟前
ActiveX调用WScript.Shell原理揭秘
开发语言
传奇开心果编程1 小时前
【Flutter踩坑排雷】第28课:平台目录缺失与修复坑|`flutter create` 的“重建”与“覆盖”边界
android·flutter·ios·移动开发·跨平台·dart·声明式ui
3095566661 小时前
股票接口返回 404 与空数组的排查笔记:证书状态与级别参数
java·笔记·python·ios·iphone·股票数据api·股票数据接口
晴天的雨.9922 小时前
【C++】继承篇
java·开发语言·c++
SomeOtherTime2 小时前
第 1 讲:内存布局与所有权解剖——栈帧、胖指针与“移动/拷贝”在汇编层面的真实面目
java·开发语言·汇编
总要学点什么2 小时前
第106篇:三维特效-流动线效果——让一颗光点沿整条线一路滚到头
开发语言·javascript·ecmascript·gis·webgl·材质·cesium
大可不必了13 小时前
03 函数定义和调用
开发语言·python