summaryrefslogtreecommitdiff
path: root/.tmux.conf
blob: 590ebcf43c7fbb70b112d741290c8ee3cf4ee98f (plain)
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
# start a new session: means "tmux attach" will always do something
# sensible

new-session

# --- preferencs


set -g base-index 1
set -g pane-base-index 1
set -g utf8
set-window-option -g utf8 on
set -g history-limit 10000
set -sg escape-time 1
set -g set-titles on
set -g set-titles-string "tmux #I:#W"
setw -g mode-keys vi
set-window-option -g xterm-keys on
set -g default-terminal "screen-256color"

# --- status bar

set -g status-utf8 on
set -g status-justify centre
setw -g monitor-activity on
set -g visual-activity on
set -g status-left-length 70
set -g status-left "#[fg=green]: #h"
set -g status-right-length 60
set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::"

# --- key bindings

unbind C-b
set -g prefix C-e

# C-z Z to send C-z to e.g. nested tmux, and C-z C-z to bounce between windows
bind e send-prefix
unbind C-e
bind-key C-e last-window

# splitting should maintain current working directory
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

# my launcher shortcuts
unbind t
bind-key m   command-prompt -p "man" "split-window 'exec man %%'"
bind-key t   command-prompt -p "host" "split-window 'mosh %1'"
bind-key C-t command-prompt -p "host" "new-window -n %1 'mosh %1'"

# --- zenburn from https://github.com/plathrop/dotfiles/blob/master/tmux/zenburn.conf

setw -g clock-mode-colour colour117
setw -g mode-attr bold
setw -g mode-fg colour117
setw -g mode-bg colour238
set -g status-bg colour235
set -g status-fg colour248
set -g status-attr dim
set -g status-left ' #[fg=colour174][ #[fg=colour187,bold]#(whoami)@#h #[fg=colour174]]'
set -g status-right '#[fg=colour174][ #[fg=colour187,bold]%d %h %H:%M #[fg=colour174]] '
set -g status-right-length 80
setw -g window-status-current-fg colour223
setw -g window-status-current-bg colour237
setw -g window-status-current-attr bold
set -g message-attr bold
set -g message-fg colour117
set -g message-bg colour235
set-option -g status-position top

# --- terminal keycode fixes

set -g terminal-overrides "xterm*:kf1=\e[11~:kf2=\e[12~:kf3=\e[13~:kf4=\e[14~:kf5=\e[15~:kf6=\e[17~:kf7=\e[18~:kf8=\e[19~"
# set -g terminal-overrides "xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@"