ipv6 kernel parameters
[dotFiles.git] / .tmux.conf
blob112d8d24e63e14de67dd7175e1f09875a3013c91
1 # ~/.tmux.conf
2 # version >= 2.8
4 # easy reload config
5 bind r source-file $HOME/.tmux.conf \; display-message "$HOME/.tmux.conf reloaded."
7 # C-a as prefix key similar screen
8 set -g prefix C-a
10 # C-a a, send commands to embedded tmux session
11 bind a send-prefix
13 # switch to last window
14 bind C-a last-window
16 # window split
17 unbind '"'
18 unbind '%'
19 bind - split-window -v
20 bind = split-window -h
22 # switch panes
23 bind -r k select-pane -U
24 bind -r j select-pane -D
25 bind -r h select-pane -L
26 bind -r l select-pane -R
28 # resize panes
29 bind -r C-k resize-pane -U 2
30 bind -r C-j resize-pane -D 2
31 bind -r C-h resize-pane -L 4
32 bind -r C-l resize-pane -R 4
34 # popup pane
35 if-shell -b '[ $(echo "$(tmux -V | cut -d" " -f2 | tr -d " [:alpha:]") > 3.1" | bc) -eq 1 ]' '\
36     bind C-p display-popup -E -w 75% -h 75%'
38 # default statusbar and fg,bg colors
39 set -g status-style fg=colour6
40 # window color
41 if-shell -b '[ $(echo "$(tmux -V | cut -d" " -f2 | tr -d " [:alpha:]") > 2.9" | bc) -eq 1 ]' '\
42         set -gw window-style bg=black; \
43         set -gw window-active-style bg=terminal'
44 # window title colors
45 set -gw window-status-style fg=colour6
46 set -gw window-status-current-style fg=colour3,bright
47 # separator between windows numbers
48 #set -gw window-status-separator ' | '
49 # message text color
50 set -g message-style fg=colour1
51 # pane number display fg color
52 set -g display-panes-colour colour7
53 set -g display-panes-active-colour colour3
54 # pane border display color
55 set -g pane-border-style fg=colour7
56 set -g pane-active-border-style fg=colour3
57 #set -g pane-border-status bottom
59 # status style
60 set -g status-interval 1
61 set -g status-justify left # left | centre | right | absolute-centre
62 set -g status-left-length 80
63 set -g status-right-length 50
64 set -g status-left ' #[fg=colour7]#{?client_prefix,#[fg=colour1],}[#{?SSH_CONNECTION,SSH:,}#S] #[default]'
65 set -g status-right '#[fg=colour7][#h] #[fg=colour6][%a %h %d %T %Y] '
66 #set -g base-index 1 # start window index from 1
67 #set -g pane-base-index 1 # start pane index from 1
68 set -g renumber-windows on # reorder window num
70 # allow mouse
71 set -g mouse on
73 # history
74 set -g history-limit 30000
76 # window notifications
77 set -gw monitor-activity off
78 set -g visual-activity on
80 # update the TERM variable of terminal emulator
81 set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY XDG_SESSION_TYPE TERM'
83 # vi-mode copy to system clipboard
84 setw -g mode-keys vi
85 if-shell -b 'hash xclip 2>/dev/null' '\
86     bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"; \
87     bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"'
88 if-shell -b 'hash xsel 2>/dev/null' '\
89     bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -b"; \
90     bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xsel -i -b"'
91 if-shell -b 'hash wl-copy 2>/dev/null' '\
92     bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"; \
93     bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "wl-copy"'
94 if-shell -b 'hash pbcopy 2>/dev/null' '\
95     bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"; \
96     bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"'
98 # scroll one line a time
99 if-shell -b '[ $(echo "$(tmux -V | cut -d" " -f2 | tr -d " [:alpha:]") > 2.4" | bc) -eq 1 ]' '\
100     bind -T copy-mode-vi WheelUpPane send -N1 -X scroll-up; \
101     bind -T copy-mode-vi WheelDownPane send -N1 -X scroll-down'
103 # 256 colors
104 # curl -LO https://invisible-island.net/datafiles/current/terminfo.src.gz && gunzip terminfo.src.gz
105 # /usr/bin/tic -xe tmux-256color terminfo.src
106 if-shell '[ "$(tput colors)" = "256" ]' '\
107     set -g default-terminal tmux-256color; set -ga terminal-overrides ",*256col*:Tc"' '\
108     set -g default-terminal xterm'