-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
101 lines (78 loc) · 2.58 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
# Use something easier to type as the prefix.
set -g prefix C-e
unbind C-e
bind C-e send-prefix
# Relax!
set -sg escape-time 0
set -sg repeat-time 600
# Reload the config.
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# Saner splitting.
bind v split-window -h
bind s split-window -v
bind S choose-session
# Window movement
bind-key -n C-h previous-window
bind-key -n C-l next-window
# Pane movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Pane resizing
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5
# 256 colors please
set -g default-terminal "screen-256color"
# window colors
set -g status-fg colour230
set -g status-bg colour234
# tmux <= 2.8
# set -g window-status-activity-attr bold
# set -g pane-border-fg colour241
# set -g pane-active-border-fg colour37
# set -g message-fg colour125
# set -g message-bg colour254
# set -g message-attr bold
# tmux > 2.8
set -g window-status-activity-style bold
set -g pane-border-style fg=colour241
set -g pane-active-border-style fg=colour37
set -g message-style fg=colour125,bg=colour254,bold
# Custom status bar
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 5
set -g status-left '#[fg=colour37,bg=colour235,bold] #S '
set -g status-right '#[fg=colour136,bg=colour235,bold] #h '
set -g window-status-format "#[fg=colour245,bg=colour234] #I - #W "
set -g window-status-current-format "#[fg=colour234,bg=colour33,noreverse,bold] #I - #W "
# Activity
setw -g monitor-activity on
set -g visual-activity off
# Autorename sanely.
setw -g automatic-rename on
# Better name management
bind c new-window
bind , command-prompt "rename-window '%%'"
# Up the stored history
set -g history-limit 1000000
# version-specific configuration
# tmux == 2.1 (Ubuntu Xenial, etc)
if-shell "tmux -V | grep '2.1'" 'source-file ~/.files/tmux/tmux-2.1.conf'
# tmux >= 3.1 (usually Mac Homebrew)
if-shell "tmux -V | grep '[3456789].[0123456789][[:alpha:]]*'" 'source-file ~/.files/tmux/tmux-latest.conf'
# Use vi bindings in copy mode
setw -g mode-keys vi
# vim-style copying
unbind [
bind C-u copy-mode
unbind p
bind p paste-buffer
# fix shitty MacOSX behavior
# see https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
set-option -g default-command "if type reattach-to-user-namespace > /dev/null ; then reattach-to-user-namespace -l zsh; else zsh; fi;"
# Save pane history to file
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'