Skip to content

Instantly share code, notes, and snippets.

@stephenlb
Last active July 26, 2026 15:18
Show Gist options
  • Select an option

  • Save stephenlb/c416358cc89f2f867dc01af349fa188c to your computer and use it in GitHub Desktop.

Select an option

Save stephenlb/c416358cc89f2f867dc01af349fa188c to your computer and use it in GitHub Desktop.
Ghostty + Tmux Config
set nowrap
set nobackup
set undofile " Undo across sessions
set undolevels=2000 " Keep 2000 changes to be undone
set undodir=~/.vim/tmp/undo//
"nmap <F2> :.w !pbcopy<CR><CR>
"vmap <F2> :w !pbcopy<CR><CR>
set noswapfile
set t_Co=256
set background=dark
colorscheme gruvbox
syntax enable
set hlsearch
set number
set et
set sw=4
set smarttab
set autoindent
set relativenumber
set nomodeline
"set statusline=%l(%L):%c\ \ %F
"true color support
if (has("termguicolors"))
set termguicolors
endif
au BufRead,BufNewFile *.md set filetype=markdown
au BufRead,BufNewFile *.clj set filetype=clojure
au BufRead,BufNewFile *.vue set filetype=html
"imap <C-]> <Plug>(copilot-next)
"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"let g:copilot_settings = #{selectedCompletionModel: 'gpt-4.1-copilot'}
## Gruvbox Color Pallet
background = #282828
foreground = #ebdbb2
selection-background = #ebdbb2
selection-foreground = #282828
cursor-color = #ebdbb2
cursor-text = #282828
palette = 0=#282828
palette = 1=#cc241d
palette = 2=#98971a
palette = 3=#d79921
palette = 4=#458588
palette = 5=#b16286
palette = 6=#689d6a
palette = 7=#a89984
palette = 8=#928374
palette = 9=#fb4934
palette = 10=#b8bb26
palette = 11=#fabd2f
palette = 12=#83a598
palette = 13=#d3869b
palette = 14=#8ec07c
palette = 15=#ebdbb2
# Pass C-Tab and C-S-Tab to tmux
keybind = ctrl+tab=text:\x1b[27;5;9~
keybind = ctrl+shift+tab=text:\x1b[27;6;9~
font-size = 23
cursor-style = block
cursor-style-blink = false
shell-integration-features = no-cursor
cursor-color = #ff00ff
title = " "
## Allow Mouse Copy Highlight
set -g mouse on
## Allow window focus tracking
set -g focus-events on
# Allow pressing prefix in quick succession to be recognized (optional but helpful)
set -s escape-time 0
# Scrollback depth (screen's `defscrollback 200000`)
set -g history-limit 200000
##### Status line styled to resemble your screen hardstatus #####
# [ Stephen Blum ] on the left; date/time on the right
set -g status on
set -g status-interval 5
# Colors roughly analogous to your screen scheme (kept simple/legible)
set -g status-style "bg=colour8,fg=colour15"
# Left: [ Stephen Blum ]
set -g status-left " #[bold][ Stephen Blum ] "
# Window list formatting (similar to %n%f %t in screen)
set -g window-status-format " #I#F #W "
set -g window-status-current-format "#[bold,reverse] #I#F #W #[default]"
# Right: date/time like '%m/%d %c' (month/day and clock)
# Using shell date for familiar strftime tokens
set -g status-right "#(date +\"%m/%d %H:%M\") "
# Optional: show window list centered-ish by padding
set -g status-left-length 30
set -g status-right-length 30
# Left / previous window
#bind -r h previous-window
#bind -r j previous-window # per your example: Ctrl-A j = move left
# Right / next window
#bind -r l next-window
#bind -r k next-window # symmetric: Ctrl-A k = move right
# Use C-a as the prefix (like screen)
set -g prefix C-a
unbind C-b
bind a send-prefix # C-a a -> send literal C-a to the pane
bind C-a last-window # C-a C-a -> toggle to last window
# General behavior (kept screen-like)
set -g base-index 0
setw -g pane-base-index 0
# Window selection
bind "'" command-prompt -p "Select window (index or name):" "select-window -t:%%" # C-a '
bind '"' choose-window # C-a "
# Digits 0–9 already select windows by default in tmux after prefix
# Previous/next window
bind Space next-window # C-a Space
bind n next-window # C-a n
bind C-n next-window # C-a C-n
bind BSpace previous-window # C-a Backspace
bind C-h previous-window # C-a C-h
bind p previous-window # C-a p
bind C-p previous-window # C-a C-p
bind N display-message "#{window_index}: #{window_name}" # C-a N show number and title
# New/kill/rename windows
bind c new-window # C-a c
bind C-c new-window # C-a C-c
#bind k kill-window # C-a k
#bind C-k kill-window # C-a C-k
bind A command-prompt -I '#W' "rename-window -- '%%'" # C-a A
# Detach/quit/session control
#bind d detach-client # C-a d
#bind C-d detach-client # C-a C-d
bind '\' confirm-before -p "Kill session #{session_name}? (y/n)" "kill-session" # C-a \
# C-a D D (pow_detach) is not supported distinctly in tmux
bind D display-message "pow_detach not supported in tmux" # C-a D (placeholder)
# Help / command line
bind '?' list-keys # C-a ?
bind : command-prompt # C-a :
# Copy/paste (scrollback)
bind [ copy-mode # C-a [
bind C-[ copy-mode # C-a C-[
bind Escape copy-mode # C-a Esc
bind ] paste-buffer # C-a ]
bind C-] paste-buffer # C-a C-]
# Pane (region) management
bind S split-window -v # C-a S (horizontal split in screen -> vertical split below in tmux)
bind '|' split-window -h # C-a | (vertical split in screen -> horizontal split right in tmux)
#bind X kill-pane # C-a X (remove region)
#bind Q kill-pane -a # C-a Q (only: keep current pane, kill others)
bind Tab select-pane -t:.+ # C-a Tab (focus next region)
bind -n C-Tab select-pane -t:.+ # C-a C-Tab (focus next region)
#bind -n BTab select-pane -t:.- # C-a BTab (focus previous region)
#bind -n C-BTab select-pane -t:.- # C-a C-BTab (focus previous region)
bind F resize-pane -Z # C-a F (fit: toggle zoom current pane)
# Lock/suspend/reset/refresh
#bind x lock-session # C-a x
#bind C-x lock-session # C-a C-x
#bind z suspend-client # C-a z
#bind C-z suspend-client # C-a C-z
#bind Z send-keys C-c \; send-keys "reset" \; send-keys Enter # C-a Z (reset VT)
# Info/monitoring/notifications
bind i display-message "sess:#S win:#I:#W pane:#P pid:#{pane_pid} tty:#{pane_tty} size:#{pane_width}x#{pane_height}" # C-a i
bind M if -F '#{monitor-activity}' 'setw monitor-activity off \; display-message "Monitor activity: off"' 'setw monitor-activity on \; display-message "Monitor activity: on"' # C-a M
bind _ if -F '#{==:#{monitor-silence},0}' 'setw monitor-silence 30 \; display-message "Silence monitor: 30s"' 'setw monitor-silence 0 \; display-message "Silence monitor: off"' # C-a _
bind C-g if -F '#{visual-bell}' 'set -g visual-bell off \; display-message "Visual bell: off"' 'set -g visual-bell on \; display-message "Visual bell: on"' # C-a C-g
# Logging / hardcopy
bind H if -F '#{pane_pipe}' 'pipe-pane \; display-message "Logging stopped"' 'pipe-pane -o "cat >> ~/screenlog.#S-#I-#P.log" \; display-message "Logging to ~/screenlog.#S-#I-#P.log"' # C-a H
bind h command-prompt -p "Hardcopy to file:" "capture-pane -epS -100000; save-buffer -- '%%'; delete-buffer" # C-a h
# Flow control passthrough (send literal XON/XOFF to pane)
bind q send-keys C-q # C-a q (xon)
bind C-q send-keys C-q
bind s send-keys C-s # C-a s (xoff)
bind C-s send-keys C-s
# Version
bind v display-message "tmux #{version}" # C-a v
# Buffers (write/read/remove)
#bind '>' command-prompt -p "Save buffer to file:" "save-buffer -- '%%'" # C-a >
#bind '<' command-prompt -p "Load buffer from file:" "load-buffer -- '%%'" # C-a <
#bind '=' delete-buffer -a # C-a = (remove all buffers)
# Window list
bind w choose-window # C-a w
bind C-w choose-window # C-a C-w
bind '"' choose-window # C-a "
# Misc: choose-tree as a “displays” approximation
bind '*' choose-tree -Zw # C-a * (show sessions/windows/panes)
# Unsupported or not applicable in tmux (provide gentle feedback)
bind f display-message "flow (XON/XOFF auto) not supported in tmux" # C-a f
bind B display-message "pow_break not supported in tmux" # C-a B
bind L display-message "login slot toggle not applicable in tmux" # C-a L
bind m display-message "lastmsg not available in tmux" # C-a m
bind r display-message "line-wrap toggle not supported by tmux" # C-a r
bind W display-message "80/132 column toggle not supported in tmux" # C-a W
bind C-v display-message "digraph entry not supported in tmux" # C-a C-v
bind . display-message "dumptermcap not supported in tmux" # C-a .
bind , display-message "license info: tmux is not GNU Screen" # C-a ,
bind '{' display-message "history (prev command line) not supported" # C-a {
bind '}' display-message "history (prev command line) not supported" # C-a }
# Note: C-a - (select -) has no direct screen-equivalent in tmux; omitted.
# Use vi keys in copy mode
set -g mode-keys vi
# Enter copy mode (kept from earlier)
bind [ copy-mode
bind C-[ copy-mode
# Copy-mode (vi) bindings
# Space toggles: first press begins visual selection, second press yanks and exits
bind -T copy-mode-vi Space if -F '#{selection_present}' \
'send-keys -X copy-selection-and-cancel' \
'send-keys -X begin-selection'
# Common Vim-like selections
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi V send-keys -X select-line
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
# Yank/cancel
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind -T copy-mode-vi Enter send-keys -X copy-selection-and-cancel
bind -T copy-mode-vi Escape send-keys -X cancel
# Disable Esc-k / Alt-k
unbind -n M-k
unbind -T prefix k
unbind -T prefix C-k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment