-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
123 lines (95 loc) · 3.5 KB
/
.tmux.conf
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# use ^A rather than ^B for the prefix key
set -g prefix ^A
unbind -n ^B
# bells in any window get sent to the terminal
set -g bell-action any
set -s escape-time 0
setw -g aggressive-resize on
# on Solaris, set-clipboard leads to core dumps!
set -g set-clipboard off
# lots of scrollback
set -g history-limit 10000
# logs of colors
set -g default-terminal "screen-256color"
# avoid needing to manually renumber (even though I keybound it)
set-option -g renumber-windows on
set-window-option -g window-style fg=white,bg=colour235
set-window-option -g window-active-style fg=white,bg=colour0
set -g status-position top
if "[ `tmux -V | cut -c 6` -ge 3 ]" \
" set -g status-style fg=colour231,bg=colour238,bright \
; set -g message-style fg=colour231,bg=colour19" \
\
" set -g status-bg colour238 \
; set -g status-fg colour231 \
; set -g status-attr bright \
; set -g message-bg colour19 \
; set -g message-fg colour231"
set -g status-left " "
set -g status-right \
" #[fg=colour238]#[bg=colour0]▛#[fg=colour$RJBS_HOST_COLOR] #h "
setw -g automatic-rename off
bind w command-prompt -p "watch for" "setw monitor-content '%%'"
bind m setw monitor-activity
bind M command-prompt -p "silence (seconds)" "setw monitor-silence %%"
set -g visual-activity on
set -g visual-silence on
# use vi keybindings
setw -g mode-keys vi
set -g status-keys vi
# keybindings
bind a send-prefix
#bind A command-prompt "rename-window %%" # not used; C-a<Comma> is better
bind ^A last-window
bind W choose-window
bind ^C new-window
bind C new-window -ac "#{pane_current_path}"
bind ^D detach-client
bind ^K clear-history
bind ^W command-prompt "find-window '%%'"
bind , command-prompt "rename-window '%%'"
bind . command-prompt "rename-session '%%'"
bind R movew -r
bind / choose-buffer
bind "'" command-prompt "find-window '%%'"
bind '"' choose-tree
bind r source-file ~/.tmux.conf \; display " ✱ tmux.conf reloaded!"
unbind %
bind | split-window -h
bind - split-window -v
bind + choose-tree
bind * set synchronize-panes
bind -r n next-window
bind N next-window -a
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection
bind -T copy-mode-vi ^B send-keys -X page-up
bind -T copy-mode-vi ^F send-keys -X page-down
# pbcopy is on macOS by default and on Linux/etc machines when I remember to
# put it there, copying from https://github.com/skaji/remote-pbcopy-iterm2
#
# If we can find that program, we'll assume it will work. It might not, if I'm
# not using iTerm2 locally, or if some other nonsense, but whatever, right?
# This will work mostly.
#
# In copy mode, <Y> will copy the selection and stay in copy mode.
#
# In normal mode, <Y> (after prefix) will send the latest buffer to pbcopy.
#
# If we don't have pbcopy, though, these just say "sorry dude".
if-shell "[ -x `which pbcopy` ]" \
'bind -T copy-mode-vi Y send -X copy-pipe pbcopy \; display-message "Copied!"' \
'bind -T copy-mode-vi Y display-message "No pbcopy on this system!"'
if-shell "[ -x `which pbcopy` ]" \
'bind Y run "tmux save-buffer - | pbcopy" \; display-message "Copied!"' \
'bind Y display-message "No pbcopy on this system!"'
bind ^B choose-buffer
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
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 P pipe-pane -o "cat >>~/log/tmux/#W.log" \; display "Toggled logging to ~/log/tmux/#W.log"