-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
141 lines (112 loc) · 4.34 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
# improve colors
set -g default-terminal 'screen-256color'
# default startup command
set-option -g default-command 'reattach-to-user-namespace -l $SHELL -l'
# 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-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
# 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 90000
# scroll history
bind u copy-mode -e
# zoom with `Enter`
bind Enter resize-pane -Z
# 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
# Status bar position
set-option -g status-position top
# Status bar update interval
set -g status-interval 2
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# display session name as title in terminal tab
set -g set-titles on
setw -g automatic-rename on
# 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'
# Local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
# Style
# 003 > yellow
# 235 > grey
set -g mode-style bg=colour008,fg=default
set -g status-style bg=default
set -g message-command-style fg=colour003,bg=colour003,bright
set -g status-justify "centre"
set -g status-left-length "100"
set -g status "on"
set -g pane-active-border-style fg=colour008
set -g pane-border-style fg=colour239,bg=default,none
set -g message-style fg=colour235,bg=colour003,bright
set -g status-right-length "100"
set -g status-right fg=default,bg=default,none
set -g status-left fg=default,bg=default,none
set -g window-status-style fg=colour003,bg=default,none
set -g window-status-activity-style fg=colour003,bg=default,none
set -g window-status-separator ""
set -g status-left ""
set -g status-right ""
set -g window-status-activity-style fg=colour003
set -g window-status-format "#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[default] #W #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]"
set -g window-status-current-format "#[fg=colour235,bg=colour003,nobold,nounderscore,noitalics]#[fg=colour235,bg=colour003,bold] #W #[fg=colour003,bg=colour235,nobold,nounderscore,noitalics]"
# 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'
# tmux-open bindings
set -g @open-S 'https://www.duckduckgo.com/'
set -g @open-editor 'O'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
# Set hooks
set-hook -g session-closed 'run-shell "~/.tmux-clean"'