fdd76fc5 |
1 | # -- general ------------------------------------------------------------------- |
2 | # scrollback size |
3 | set -g history-limit 10000 |
4 | |
5 | ## set the default TERM |
6 | set -g default-terminal screen |
7 | ## update the TERM variable of terminal emulator when creating a new session or attaching a existing session |
8 | set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM' |
9 | ## determine if we should enable 256-colour support |
10 | if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color' |
11 | |
12 | setw -g xterm-keys on |
13 | # faster command sequences |
14 | set -s escape-time 10 |
15 | # increase repeat timeout |
16 | set -sg repeat-time 600 |
17 | set -s focus-events on |
18 | # rename window to reflect current program |
19 | setw -g automatic-rename on |
20 | # renumber windows when a window is closed |
21 | set -g renumber-windows on |
22 | # set terminal title |
23 | set -g set-titles on |
24 | # slightly longer pane indicators display time |
25 | set -g display-panes-time 800 |
26 | # slightly longer status messages display time |
27 | set -g display-time 1000 |
28 | # redraw status line every 5 seconds |
29 | set -g status-interval 5 |
30 | |
31 | # -- bindings ------------------------------------------------------------------ |
32 | # Changing ctrl b to ctrl Space as the command button |
33 | unbind C-b |
34 | set -g prefix C-Space |
35 | |
36 | # set first window to index 1 (not 0) to map more to the keyboard layout |
37 | set -g base-index 1 |
38 | set -g pane-base-index 1 |
39 | |
40 | # Keep your finger on ctrl, or don't, same result |
41 | bind-key C-d detach-client |
42 | # bind-key C-p paste-buffer |
43 | |
44 | # reload tmux config with ctrl + a + r |
45 | unbind r |
46 | bind-key r \ |
47 | source-file ~/.tmux.conf \;\ |
48 | display 'Reloaded tmux config.' |
49 | |
50 | # Vertical splits with v or C-v |
51 | unbind g |
52 | unbind C-g |
53 | bind-key v split-window -h |
54 | bind-key C-v split-window -h |
55 | |
56 | # Horizontal splits with h or C-h |
57 | unbind h |
58 | unbind C-h |
59 | bind-key h split-window |
60 | bind-key C-h split-window |
61 | |
62 | # F8 rename window |
63 | # unbind F8 |
64 | # unbind C-F8 |
65 | bind-key -n F8 command-prompt 'rename-window %%' |
66 | |
67 | # Ctrl - t or t new window |
68 | # unbind t |
69 | # unbind C-t |
70 | # bind-key t new-window |
71 | bind-key -n C-t new-window |
72 | |
73 | # Ctrl - w or w to kill panes |
74 | # unbind w |
75 | # unbind C-w |
76 | # bind-key w kill-pane |
77 | bind-key -n C-w kill-pane |
78 | |
79 | # C + control q to kill session |
80 | # unbind q |
81 | # unbind C-q |
82 | # bind-key q kill-session |
83 | bind-key -n C-q kill-session |
84 | |
85 | # Switching panes with Ctrl |
86 | bind-key -n C-Left select-pane -L |
87 | bind-key -n C-Right select-pane -R |
88 | bind-key -n C-Up select-pane -U |
89 | bind-key -n C-Down select-pane -D |
90 | |
91 | # Ctrl + a + n : New session |
92 | unbind n |
93 | unbind C-n |
94 | bind-key n new-session |
95 | bind-key C-n new-session |
96 | |
97 | # Ctrl + a + Pagedown : Next window |
98 | unbind Pagedown |
99 | bind-key -n C-Pagedown next-window |
100 | |
101 | # Ctrl + a + Pagup : Previous window |
102 | unbind Pageup |
103 | bind-key -n C-Pageup previous-window |
104 | |
105 | # Visual Activity Monitoring between windows |
106 | setw -g monitor-activity on |
107 | set -g visual-activity off |
108 | |
109 | # -- default session ----------------------------------------------------------- |
110 | new -s local -n danix |
111 | neww -n root su - |
112 | neww -n top htop |
113 | neww -n syswatch tail -f /var/log/messages |
114 | splitw -v -p 50 -t 1 /home/danix/bin/my_netstat |
115 | selectw -t 2 |
116 | selectp -t 1 |
117 | |
118 | # -- copy mode ----------------------------------------------------------------- |
119 | |
120 | bind-key Enter copy-mode # enter copy mode |
121 | |
122 | run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true' |
123 | run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true' |
124 | run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true' |
125 | run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true' |
126 | run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true' |
127 | run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true' |
128 | run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true' |
129 | run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true' |
130 | run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true' |
131 | run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true' |
132 | run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true' |
133 | run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true' |
134 | |
135 | # copy to X11 clipboard (needs xclip) |
136 | if -b 'command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"' |
137 | |
138 | |
139 | # -- buffers ------------------------------------------------------------------- |
140 | |
141 | bind-key b list-buffers # list paste buffers |
142 | bind-key p paste-buffer # paste from the top paste buffer |
143 | bind-key P choose-buffer # choose which buffer to paste from |
144 | |
145 | |
146 | # --theme ---------------------------------------------------------------------- |
147 | |
148 | # set -goqF @blackpearl-console-background colour59 |
149 | # set -goqF @blackpearl-console-orange colour11 |
150 | # set -goqF @blackpearl-console-dark-grey colour102 |
151 | |
152 | set -goqF @blackpearl-standard-background colour0 |
153 | set -goqF @blackpearl-orange colour3 |
154 | set -goqF @blackpearl-dark-grey colour8 |
155 | |
156 | set -goqF @theme-clock-mode-colour "#{@blackpearl-orange}" |
157 | set -goq @theme-clock-mode-style 24 |
158 | |
159 | |
160 | set -goq @blackpearl-status-left-area-left-format "\[ #h \]" |
161 | set -goq @blackpearl-status-left-area-middle-format "#(whoami)" |
162 | set -goq @blackpearl-status-left-area-right-format "" |
163 | |
164 | set -goq @blackpearl-status-right-area-left-format "" |
165 | set -goq @blackpearl-status-right-area-middle-format "[ %d-%b-%y ]" |
166 | set -goq @blackpearl-status-right-area-right-format "[ %H:%M:%S ]" |
167 | |
168 | set -goq @blackpearl-window-status-current-format "( #I:#W )" |
169 | set -goq @blackpearl-window-status-format "#I:#W" |
170 | |
171 | set -goqF @theme-status-left "#{@blackpearl-status-left-area-left-format} #{@blackpearl-status-left-area-middle-format} #{@blackpearl-status-left-area-right-format}" |
172 | set -goqF @theme-status-right "#{@blackpearl-status-right-area-left-format} #{@blackpearl-status-right-area-middle-format} #{@blackpearl-status-right-area-right-format}" |
173 | set -gqF @theme-window-status-current-format "#{@blackpearl-window-status-current-format}" |
174 | set -gqF @theme-window-status-format "#{@blackpearl-window-status-format}" |
175 | |
176 | set -gF status-justify centre |
177 | # empty part of the status bar |
178 | set -gF status-style "fg=#{@blackpearl-orange},bg=#{@blackpearl-standard-background}" |
179 | |
180 | set -gF status-left-length "40" |
181 | set -gF status-right-length "150" |
182 | set -gF status-left "#{@theme-status-left}" |
183 | # set -gF status-left "[ #h ] ♥ #(cat /etc/slackware-version)" |
184 | set -gF status-left-style "fg=#{@blackpearl-orange},bg=#{@blackpearl-standard-background}" |
185 | set -gF status-right "#{@theme-status-right}" |
186 | # set -gF status-right "%d-%b-%y | %H:%M:%S" |
187 | set -gF status-right-style "fg=#{@blackpearl-orange},bg=#{@blackpearl-standard-background}" |
188 | |
189 | set -gwF window-status-current-format "#{@theme-window-status-current-format}" |
190 | set -gwF window-status-format "#{@theme-window-status-format}" |
191 | set -gwF window-status-activity-style "fg=#{@blackpearl-orange},bg=#{@blackpearl-standard-background}" |
192 | set -gwF window-status-current-style "fg=#{@blackpearl-dark-grey},bg=#{@blackpearl-orange}" |
193 | |
194 | set -gF message-command-style "fg=#{@blackpearl-dark-grey},bg=#{@blackpearl-orange}" |
195 | set -gF message-style "fg=#{@blackpearl-dark-grey},bg=#{@blackpearl-orange}" |
196 | set -gwF clock-mode-colour "#{@theme-clock-mode-colour}" |
197 | set -gwF clock-mode-style "#{@theme-clock-mode-style}" |
198 | |
199 | # set-option -g status-style bg=colour220,fg=colour233 |
200 | # set-option -g pane-active-border-bg "#ff0000" |
201 | # set -gq @themepack-status-left-area-right-format "" |
202 | # set -gq @themepack-status-right-area-middle-format "#h" |
203 | # set -gq @themepack-status-right-area-right-format "%d-%b-%y" |
204 | # set -gq @powerline-status-bg "ffbf00" |
205 | # set -g @themepack 'powerline/block/yellow' |
206 | |
207 | # run tmux-plugin-manager |
208 | # run -b '~/.tmux/plugins/tpm/tpm' |