-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
133 lines (103 loc) · 3.65 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
# improve colors
set -g default-terminal 'screen-256color'
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# update default binding of `Enter` to also use copy-pipe
#unbind-key -T copy-mode-vi Enter
#bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
# reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display 'Reloaded !'
# act like GNU screen
unbind C-b
set -g prefix C-a
bind a send-prefix
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# Faster escape sequences (default is 500ms).
# This helps when exiting insert mode in Vim: http://superuser.com/a/252717/65504
set -s escape-time 50
# increase scrollback lines
set -g history-limit 10000
bind u copy-mode -e
# Mouse scrolling
set -g mouse off
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind-key -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind-key -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# Toggle mouse on
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
# switch to last pane
bind-key C-a last-pane
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
# Split window with | and -
unbind %
bind | split-window -h
bind - split-window -v
# Log output to a text file on demand
bind g pipe-pane -o "cat >> ~/tmp/tmux.#W.log" \; display "Started logging to ~/tmp/tmux.#W.log"
bind-key G pipe-pane \; display 'Ended logging to ~/tmp/tmux.#W.log'
# Status bar position
set-option -g status-position bottom
if-shell 'test "$(uname -s)" = Darwin' 'set-option -g status-position top'
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# Status bar update interval
set -g status-interval 2
# display session name as title in terminal tab
set -g set-titles on
setw -g automatic-rename on
#
# Theme
#
# panes
set -g pane-border-style fg=colour239,bg=default,none
set -g pane-active-border-style fg=colour231
# status line
set -g status-justify centre
set -g status-bg colour232
set -g status-fg colour246
# messaging
set -g message-style fg=colour0,bg=colour226
set -g message-command-style fg=colour27,bg=colour0
set -g automatic-rename on
# window mode
set -g mode-style bg=colour6,fg=colour0
# colors
setw -g window-status-format "#[fg=colour242] •#[fg=colour242] #W "
setw -g window-status-current-format "#[fg=colour196] •#[fg=colour231] #W "
setw -g window-status-current-style bright
set -g status-left ""
set -g status-right ""
# Local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'