-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux3.conf
153 lines (120 loc) · 5.24 KB
/
tmux3.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
set -g default-terminal "tmux-256color"
# Window numbers start with 1
set -g base-index 1
# Address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# Increase scrollback buffer size
set -g history-limit 50000
# tmux messages are displayed for 1 second
set -g display-time 1000
# Refresh 'status-left' and 'status-right' more often
set -g status-interval 5
# Use vi-style bindings
set -g mode-keys vi
#------------------------------------------------------------------------------
# Status bar configuration
#
set -g status-position top
set -g status-bg colour255
set -g status-fg colour0
# Window title colors (default and active)
set -g window-status-style fg=colour240,bg=default
set -g window-status-current-style fg=colour159,bg=colour242
# Set terminal window title
set -g set-titles on
set -g set-titles-string '#T'
set -g status-left "#[fg=blue,bold,bg=colour252][#S]#[default] "
set -g status-right " \"#{=21:host_short}\" %H:%M %d-%b-%y"
#------------------------------------------------------------------------------
# Colors
#
set -g mode-style "fg=black,bold,bg=brightcyan"
set -g message-style "fg=black,bg=colour123"
set -g message-command-style "fg=black,bg=colour123"
set -g copy-mode-match-style "fg=brightwhite,bold,bg=cyan"
set -g copy-mode-current-match-style "fg=black,bold,bg=brightgreen"
#------------------------------------------------------------------------------
# Mouse
#
# Enable mouse scrolling and resizing
set -g mouse on
# Disable mouse right click menu
unbind -n MouseDown3Pane
# tmux-better-mouse config
set -g @scroll-down-exit-copy-mode "off"
set -g @scroll-without-changing-pane "on"
set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"
#------------------------------------------------------------------------------
# Key bindings
#
# Change prefix from Ctrl+b to Alt+e
unbind C-b
set-option -g prefix M-e
bind-key M-e send-prefix
# Alt+t to create a new window
bind-key -n M-t new-window
# Alt+number to switch windows
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
# Alt+0 to reorder windows sequentially
bind-key -n M-0 move-window -r
# Move the current window to the left/right in the window list
bind-key -r < swap-window -t - \; select-window -t -
bind-key -r > swap-window -t + \; select-window -t +
# Split panes using | and -
bind-key | split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# Horizontally even layout
bind-key = select-layout even-horizontal
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'S-Left' if-shell "$is_vim" 'send-keys S-Left' 'select-pane -L'
bind-key -n 'S-Down' if-shell "$is_vim" 'send-keys S-Down' 'select-pane -D'
bind-key -n 'S-Up' if-shell "$is_vim" 'send-keys S-Up' 'select-pane -U'
bind-key -n 'S-Right' if-shell "$is_vim" 'send-keys S-Right' 'select-pane -R'
bind-key -n 'C-\' if-shell "$is_vim" 'send-keys C-\\' 'select-pane -l'
bind-key -T copy-mode-vi 'S-Left' select-pane -L
bind-key -T copy-mode-vi 'S-Down' select-pane -D
bind-key -T copy-mode-vi 'S-Up' select-pane -U
bind-key -T copy-mode-vi 'S-Right' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
#------------------------------------------------------------------------------
# Copy-paste
#
set -s copy-command 'xsel -i'
set -g word-separators " -_@"
# Selection management
bind-key -T copy-mode-vi r send -X rectangle-toggle
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi BSpace send -X clear-selection
bind-key -T copy-mode-vi y send -X copy-pipe
bind-key -T copy-mode-vi Escape send -X cancel
bind-key -T copy-mode-vi MouseDown2Pane send -X copy-pipe-and-cancel \; paste-buffer -p
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; set -g word-separators "<>(){}[]/'\";@*+,-=!£$%^&:#~?`¬|\\ " \; send -X select-word \; set -g word-separators " -_@"
bind-key -n DoubleClick1Pane select-pane \; copy-mode -M \; set -g word-separators "<>(){}[]/'\";@*+,-=!£$%^&:#~?`¬|\\ " \; send -X select-word \; set -g word-separators " -_@"
bind-key -T copy-mode-vi TripleClick1Pane select-pane \; set -g word-separators " \"'" \; send -X select-word \; set -g word-separators " -_@"
bind-key -n TripleClick1Pane select-pane \; copy-mode -M \; set -g word-separators " \"'" \; send -X select-word \; set -g word-separators " -_@"
# Navigation
bind-key -T copy-mode-vi Home send -X start-of-line
bind-key -T copy-mode-vi End send -X end-of-line
bind-key -T copy-mode-vi C-Left send -X previous-word
bind-key -T copy-mode-vi C-Right send -X next-word
#------------------------------------------------------------------------------
# Plugins
#
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'roosta/tmux-fuzzback'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'