-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf.symlink
More file actions
93 lines (73 loc) · 3.15 KB
/
Copy pathtmux.conf.symlink
File metadata and controls
93 lines (73 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Ideas sourced from:
# https://github.com/milkbikis/dotfiles-mac#bash
# https://github.com/myusuf3/dotfiles/blob/master/tmux
# Using meta:
# https://zserge.com/posts/tmux/
# https://github.com/zserge/dotfiles
#
# TO RESEARCH: https://news.ycombinator.com/item?id=23003603&utm_term=comment
# https://zserge.com/posts/tmux/
bind C-r source-file $HOME/.tmux.conf
set -g prefix C-s
unbind C-b
# If we need to actually send C-s for any reason.
# bind s send-prefix
# Keep consistent with screen behavior
bind C-s last-window
bind C-d detach
bind C-c new-window
# Use vim keys in copy mode
setw -g mode-keys vi
unbind-key -T copy-mode-vi v
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection # Begin selection in copy mode.
bind-key -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle # Begin selection in copy mode.
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection # Yank selection in copy mode.
bind -Tcopy-mode WheelUpPane send -N1 -X scroll-up
bind -Tcopy-mode WheelDownPane send -N1 -X scroll-down
set -g default-terminal "tmux-256color"
# Set status bar
set -g status-left-length 16
set -g status-right-length 0
set -g status-interval 1
set -g status-right ''
set -g status-style "bg=colour234"
set -g status-left \
"#[fg=colour6,bg=colour4,bold] $USER@#h #[fg=colour4,bg=colour234,nobold]"
set -g window-status-format \
"#[fg=white,bg=colour234] #I #W #F "
set -g window-status-current-format \
"#[fg=colour234,bg=colour39]#[fg=colour16,bg=colour39,noreverse,bold] #I #{=20:window_name} #[fg=colour39,bg=colour234,nobold] "
# Set window notifications by bolding the title.
setw -g monitor-activity on
# set -g window-status-activity-attr bold
set -g visual-activity off
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
setw -g automatic-rename on
set -g mouse on
# Allow git-gutter to refresh status when the window gets focus
set -g focus-events on
# Stop scrolling on status bar from changing windows
unbind-key -T root WheelUpStatus
unbind-key -T root WheelDownStatus
# Eliminate pause when hitting escape in vim.
# https://www.johnhawthorn.com/2012/09/vi-escape-delays/
set -s escape-time 0
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Make sure shift-enter (e.g. for claude) works inside tmux
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
# Another option for handling nested windows - use up/down to move through
# levels. e.g.: http://stahlke.org/dan/tmux-nested/
# if 'uname | grep -q Darwin' 'source ~/.dotfiles/tmux.mac.conf'
# TODO: this should be checking for outer tmux?
if 'uname | grep -q Linux' 'source ~/.dotfiles/tmux.inner.conf'
# Source the ghostty overlay only when the tmux server was started by
# ghostty. We gate on $GHOSTTY_RESOURCES_DIR (set by ghostty, preserved by
# tmux) rather than $TERM_PROGRAM — tmux overrides TERM_PROGRAM=tmux in
# spawned shells, so that check would always fail.
if-shell '[ -n "$GHOSTTY_RESOURCES_DIR" ]' 'source-file ~/.dotfiles/tmux.ghostty.conf'