-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
181 lines (144 loc) · 6.11 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#
# ~/.tmux.conf
#set correct term
set -g default-terminal "tmux-256color"
#set -g default-terminal "xterm-256color"
#limit the scrollback buffer
set -g history-limit 100000
#start a non-login shell
#tmux starts a login shell by default
set -g default-command "${SHELL}"
#set vi mode
set -g mode-keys vi
#set -g status-keys vi
#bind-key -T copy-mode-vi 'v' send -X begin-selection
#bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
#set-window-option -g mode-keys vi
#https://sanctum.geek.nz/arabesque/vi-mode-in-tmux/
#disable tmux mouse copy-mode jumps to bottom
bind-key -T copy-mode-vi y send-keys -X copy-selection
unbind-key -T copy-mode-vi MouseDragEnd1Pane
#https://stackoverflow.com/questions/32374907/tmux-mouse-copy-mode-jumps-to-bottom
#bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
#bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
#bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
#bind-key C-S-x run "xclip -o -sel primary | tmux load-buffer - ; tmux paste-buffer"
#https://wiki.archlinux.org/title/tmux
#Tmux is not able to distinguish between insert and shift-insert
#tmux will pass these keys through to its terminals
set-option -gw xterm-keys on
#https://unix.stackexchange.com/questions/88122/tmux-is-not-able-to-distinguish-between-insert-and-shift-insert
#x clipboard integration (with xsel)
# Vim style
#copy to xsel (the same as `bind-key [..] -X copy-selection` above):
#not needed in XTerm, only XFCE4-terminal:
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
#paste from buffer:
bind-key P run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
#set -s set-clipboard off
#rebind p (used in bash readline and zsh line editors)
#bind-key ç previous-window
#mouse-mode
set -g mouse on
#display
#renumber windows when a window is closed
#set -g renumber-windows on
#automatically set window title
#set-window-option -g automatic-rename on
set-option -g set-titles on
#don't rename windows automatically
#set-option -g allow-rename off
#misc
#no delay for escape key press
#set -sg escape-time 0
#scrolling issues
#if you have issues scrolling with shift-page up/down in your terminal
#set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
#consider using tmux natice scrollback
#key bindings
#set ctrl+a as in gnu screen
unbind-key C-b
set -g prefix C-a
bind-key C-a send-prefix
#reload tmux config file
bind-key r source-file ~/.tmux.conf
#automatic layouting
#when creating new splits or destroying older ones the currently selected layout isn't applied.
#to fix that, add following binds which will apply the currently selected layout to new or remaining panes:
#bind-key -n M-c kill-pane \; select-layout
#bind-key -n M-n split-window \; select-layout
#tip: you may be interested in tmux-xpanesAUR which makes managing window layouts and ssh connections easy.
#change how pane splits
#bind-key h split-window -h
#bind-key v split-window -v
#pane navigation
#bind-key -r h select-pane -L # move left
#bind-key -r j select-pane -D # move down
#bind-key -r k select-pane -U # move up
#bind-key -r l select-pane -R # move right
bind-key > swap-pane -D # swap current pane with the next one
bind-key < swap-pane -U # swap current pane with the previous one
#create a new window if another one does not exist
bind-key 0 if-shell 'tmux select-window -t :0' '' 'new-window -t :0'
bind-key 1 if-shell 'tmux select-window -t :1' '' 'new-window -t :1'
bind-key 2 if-shell 'tmux select-window -t :2' '' 'new-window -t :2'
bind-key 3 if-shell 'tmux select-window -t :3' '' 'new-window -t :3'
bind-key 4 if-shell 'tmux select-window -t :4' '' 'new-window -t :4'
bind-key 5 if-shell 'tmux select-window -t :5' '' 'new-window -t :5'
bind-key 6 if-shell 'tmux select-window -t :6' '' 'new-window -t :6'
bind-key 7 if-shell 'tmux select-window -t :7' '' 'new-window -t :7'
bind-key 8 if-shell 'tmux select-window -t :8' '' 'new-window -t :8'
bind-key 9 if-shell 'tmux select-window -t :9' '' 'new-window -t :9'
#https://unix.stackexchange.com/questions/285613/
#bind-key n run-shell "tmux switch-client -n || tmux new-window"
#bind-key n run-shell "tmux switch-client -n || tmux new-client"
#pane resizing
#bind-key -r H resize-pane -L 2
#bind-key -r J resize-pane -D 2
#bind-key -r K resize-pane -U 2
#bind-key -r L resize-pane -R 2
#themes
#set -g status-bg black
#set -g status-fg white
#set -g window-status-current-bg white
#set -g window-status-current-fg black
#set -g window-status-current-attr bold
#set -g status-interval 60
#set -g status-left-length 30
#set -g status-left '#[fg=green](#S) #(whoami)'
#set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
set -g status-fg darkblue
######################
### DESIGN CHANGES ###
######################
#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=colour1 bg=colour18 bold'
#panes
#set -g pane-border-style 'fg=colour19 bg=colour0'
#set -g pane-active-border-style 'bg=colour0 fg=colour9'
#statusbar
#set -g status-position bottom
#set -g status-justify left
set -g status-style 'bg=colour5' # fg=colour137 dim'
set -g status-fg white
#set -g status-left ''
#set -g status-right '#[fg=colour233,bg=colour19] %d/%m #[fg=colour233,bg=colour8] %H:%M:%S '
#set -g status-right-length 50
#set -g status-left-length 20
#setw -g window-status-current-style 'fg=colour1 bg=colour19 bold'
#setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '
#setw -g window-status-style 'fg=colour9 bg=colour18'
#setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
#setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
#messages
#set -g message-style 'fg=colour232 bg=colour16 bold'
#https://github.com/gpakosz/.tmux/blob/master/.tmux.conf#L41
#https://gist.github.com/spicycode/1229612
#https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/