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