-
Notifications
You must be signed in to change notification settings - Fork 8
/
.tmux.conf
146 lines (110 loc) · 4.66 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
142
143
144
145
146
# reload config file (change file location to your the tmux.conf you want to use)
unbind r
bind r \
source-file ~/.tmux.conf \;\
display 'Reloaded tmux config.'
###############################################
####### INTERACTION ########
###############################################
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# switch windows using Alt-arrow without prefix
bind -n M-h previous-window
bind -n M-l next-window
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
# create session
bind C-c new-session
# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# split current window horizontally
bind - split-window -v
# split current window vertically
bind _ split-window -h
# Buffers
bind b list-buffers # list paste buffers
bind p paste-buffer # paste from the top paste buffer
bind P choose-buffer # choose which buffer to paste from
# Copy to clipbord
if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
# copy to macOS clipboard
if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | pbcopy"'
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# copy to Windows clipboard
if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | clip.exe"'
if -b '[ -c /dev/clipboard ]' 'bind y run -b "tmux save-buffer - > /dev/clipboard"'
# copy mode
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi V send -X select-line
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
###############################################
###### Other Changes ######
###############################################
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s focus-events on
set -q -g status-utf8 on
setw -q -g utf8 on
set -g history-limit 10000 # boost history
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history
###############################################
###### Display changes ######
###############################################
set -g default-terminal "xterm-256color"
set -as terminal-features ",xterm-256color:RGB"
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
# activity
set -g monitor-activity on
set -g visual-activity off
###############################################
###### Design ######
###############################################
# loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# modes
setw -g clock-mode-colour colour5
setw -g mode-style 'fg=colour16 bg=#C678DD bold'
###############################################
###### Status Line ######
###############################################
# status border
set-window-option -g pane-border-status off
# setw -g pane-border-status bottom
# setw -g pane-border-format ''
# set -g pane-active-border-style bg=default,fg=#000000
# set -g pane-border-style fg=#000000
#
# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style 'bg=#000000 fg=colour255 '
set -g status-left ' #[fg=#C678DD] #S '
set -g status-right '#[fg=colour16,bg=#efbd5d] #(hostname -s) '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-style 'fg=colour16 bg=#54b0fd bold'
setw -g window-status-current-format ' #I#[fg=colour16]:#[fg=colour16]#W#[fg=colour16]#F '
setw -g window-status-style 'fg=colour255 bg=#000000'
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '