终端工具配置

文章目录

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
相关推荐
simple-L65 分钟前
Vue3 前端开发技术文章大纲
开发语言
南宫萧幕6 分钟前
Python与Simulink联合仿真:基于DQN的HEV能量管理策略建模与全链路排雷实战
开发语言·人工智能·python·算法·机器学习·matlab·控制
千寻girling12 分钟前
滑动窗口刷了快一个月(26天)了 , 还没有刷完. | 含(操作系统学什么的Java 后端)
java·开发语言·javascript·c++·人工智能·后端·python
曾凡玉@24 分钟前
Python 并发编程系统笔记
开发语言·笔记·python
代码中介商25 分钟前
C语言核心知识完全回顾:从数据类型到动态内存管理
c语言·开发语言
故事还在继续吗28 分钟前
C++多线程与多进程编程
开发语言·c++
幽络源小助理35 分钟前
影视脚本分镜在线协作系统源码 PHP剧本创作平台
开发语言·php
.柒宇.43 分钟前
FastAPI进阶教程
开发语言·python·fastapi
JQLvopkk1 小时前
C# 工业级上位机:交互实战
开发语言·c#·交互
jimy11 小时前
C语言中的 “size_t ”类型
c语言·开发语言