-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
111 lines (91 loc) · 3.22 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
# tmux.conf
unbind l
unbind s
# window index start with 1
set -g base-index 1
setw -g pane-base-index 1
# --------------------
# prefix
# --------------------
unbind C-b
set -g prefix C-b
# --------------------
# window
# --------------------
set -g automatic-rename off
set-option -g set-titles on
set -g history-limit 10000
setw -g mode-keys vi
set -g mouse on
# --------------------
# status line
# --------------------
set -g status-keys vi
setw -g monitor-activity on
setw -g visual-activity on
set -g status on
set -g status-interval 5
set -g status-justify centre
set -g status-style "bg=#333333,fg=#ffffff"
set -g pane-active-border-style "bg=cyan,fg=#333333"
set -g window-status-format " #I: #W "
set -g window-status-current-format "#[fg=#333333,bg=cyan,attr=bold] #I: #W #[default]"
set -g window-status-current-style "bg=cyan,fg=#333333"
set -g status-left-length 120
set -g status-right-length 180
set -g status-left "#[fg=green,bg=#303030]#{?client_prefix,#[reverse],}#(whoami):[#S:#I.#P]:#[fg=brightcyan]#{pane_current_path}"
set -g status-right "#[bg=#303030]#(sh $HOME/.tmux-kube 250 green brightcyan):[%Y-%m-%d(%a) %H:%M:%S]"
# --------------------
# key bind
# --------------------
bind-key -n WheelUpPane if-shell -Ft= "#{?pane_in_mode,1,#{alternate_on}}" "send-keys -M" "copy-mode"
bind c new-window -c "#{pane_current_path}"
bind v split-window -hc "#{pane_current_path}"
bind s split-window -vc "#{pane_current_path}"
bind-key -r C-j resize-pane -D 5
bind-key -r C-k resize-pane -U 5
bind-key -r C-h resize-pane -L 5
bind-key -r C-l resize-pane -R 5
bind-key -r M-j resize-pane -D 5
bind-key -r M-k resize-pane -U 5
bind-key -r M-h resize-pane -L 5
bind-key -r M-l resize-pane -R 5
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Use Alt-arrow keys without prefix key to switch panes
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
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
unbind r
bind r source-file ~/.tmux.conf
# copy Linux
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
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"
# --------------------
# Theme
# --------------------
# set the default TERM
#set -g default-terminal screen
# update the TERM variable of terminal emulator when creating a new session or attaching a existing session
#set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
# determine if we should enable 256-colour support
#if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
#set -g default-command "${SHELL}"
if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
if "[[ ${hostname} =~ docker ]]" 'set -g default-terminal screen-256color'