forked from demure/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
172 lines (145 loc) · 5.63 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
##### My (demuredemeanor) tmux config, a work in progress
# Uses tabstop=4; shiftwidth=4 tabs; foldmarker={{{,}}};
# https://notabug.org/demure/dotfiles/
# legacy repo http://github.com/demure/dotfiles
#
# Note to self: set=set-option; setw=set-window-option; setenv=set-environment;
### Main Settings ### {{{
## Fix glitch with underlined text in Terminal.app and hanging Prompt (iOS)
## From https://github.com/terlar/dotfiles/blob/master/tmux.conf
## Assume http://sourceforge.net/mailarchive/message.php?msg_id=30825085 is origin
set -ag terminal-overrides ",*:XT@"
new-session # tmux attach makes new, if not running
set -ga update-environment 'DISPLAY' # Maybe fix DISPLAY?
set -g base-index 1 # Window numbering starts at 1
set -g pane-base-index 1 # Pane numbering starts at 1
setw -g automatic-rename on # Auto set window title
setw -g aggressive-resize on # Aggressive windows: For screen size, of diff connections, on diff windows
set -g default-terminal "screen-256color"
set -g history-limit 10000 # Scroll back history
set -g display-panes-time 4000 # Increase show pane time
set -g renumber-windows on # Make windows auto renumber
set -g lock-command vlock # Use vlock as console lock
### End Main Settings ### }}}
### Key Bindings ### {{{
unbind C-z # Unbind C-z so I don't suspend, and free for bind
unbind C-b # Unbind C-b, so I can make C-z the prefix
set -g prefix C-z # Change prefix key to C-z
bind-key C-z last-window # Make <prefix>C-z go to last window
unbind C-a
bind-key C-a send-prefix # Make <prefix>C-a send C-z literally
## Join windows: <prefix> s, <prefix> j
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
## URL grab: <prefix> u
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'
## Reload tmux.conf: <prefix> R
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
## Lock screen
bind-key -T prefix X confirm-before -p "lock tmux? (y/n)" lock-session
### Better Bindings for Splitting ### {{{
unbind %
# bind | split-window -h
bind h split-window -h
unbind '"'
# bind - split-window -v
bind v split-window -v
### End Splitting Bindings ### }}}
### Mouse On/Off ### {{{
## Mouse On by default
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
##Toggle mouse on with <prefix>m
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
## Toggle mouse off with <prefix>M
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
### End Mouse On/Off ### }}}
### vi Mode for Scroll Back ### {{{
setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind-key -t vi-copy Escape cancel
bind-key -t vi-copy 'Y' copy-end-of-line
bind-key -t vi-copy 'V' select-line
### End vi Mode ### }}}
### Move Window Numbers ### {{{
## <prefix> Shift left/right
# Inspired by https://superuser.com/questions/343572/how-do-i-reorder-tmux-windows
bind-key S-Left swap-window -t -1
bind-key S-Right swap-window -t +1
### End Window Numbers ### }}}
### End Key Bindings ### }}}
### Theming Settings ### {{{
## Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
## Notifying if other windows has activities
setw -g monitor-activity on
set -g visual-activity on
## Clock
setw -g clock-mode-colour green
setw -g clock-mode-style 24
## Inactive windows
setw -g window-status-format '#[fg=cyan,dim]#I#[fg=blue]:#[default]#W#[fg=grey,dim]#F'
### Status Bar ### {{{
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-left '#[fg=green]#H#[default]'
# set -g status-right '#[fg=yellow]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'
set -g status-right '#[fg=cyan,bold]%Y-%m-%d %H:%M#[default]'
### Bar Bell ### {{{
#setw -g window-status-bell-attr attributes
#setw -g window-status-bell-bg colour
#setw -g window-status-bell-fg colour
### End Bell ### }}}
### Bar Content ### {{{
#setw -g window-status-content-attr attributes
#setw -g window-status-content-bg colour
#setw -g window-status-content-fg colour
### End Content ### }}}
### Bar Activity ### {{{
#setw -g window-status-activity-attr attributes
#setw -g window-status-activity-bg colour
#setw -g window-status-activity-fg colour
### End Activity ### }}}
### Bar Current ### {{{
## Highlighting the active window in status bar
#setw -g window-status-current-bg blue
setw -g window-status-current-format '#[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=white]#W#[fg=dim]#F'
### End Current ### }}}
### Bar Last ### {{{
#setw -g window-status-last-attr attributes
#setw -g window-status-last-bg color
#setw -g window-status-last-fg color
### End Last ### }}}
### End Status Bar ### }}}
### Message/Message Command ### {{{
set -g message-attr bright
set -g message-bg cyan
set -g message-fg white
set -g message-command-attr bright
set -g message-command-bg cyan
set -g message-command-fg white
### End Message ### }}}
### Pane Colors ### {{{
set -g pane-border-fg cyan
set -g pane-active-border-fg cyan
### End Pane Colors ### }}}
### End Theming Settings ### }}}