forked from appleboy/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
99 lines (82 loc) · 2.65 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
# Written by appleboy.tw AT gmail.com
# General Setting
set-option -g prefix C-a
set-window-option -g automatic-rename off
set-option -g default-shell /bin/bash
set -g base-index 1
set -g display-time 5000
set -g repeat-time 1000
set -g status-keys vi
set -g status-bg black
set -g status-fg white
set -g status-justify left
set -g status-interval 1
set -g status-left-length 15
set -g status-right-length 70
set -g status-left "#[fg=white,bright,bg=blue] Session #[fg=yellow,bright,bg=blue]#S #[default] |" # session-name
set -g status-right "#[fg=white,bright]#(uptime | cut -d ',' -f 3-) #[fg=yellow,bright] %Y-%m-%d #[fg=green]%H:%M:%S"
# Fix putty/pietty function key problem
# set -g terminal-overrides "xterm*:kf1=\e[11~:kf2=\e[12~:kf3=\e[13~:kf4=\e[14~:kf5=\e[15~:kf6=\e[17~:kf7=\e[18~:kf8=\e[19~"
# Configuration for each window.
# $ tmux show-window-options -g
setw -g window-status-current-bg red
setw -g window-status-current-fg white
setw -g window-status-current-attr default
# Binding key
bind C-a send-prefix
bind -n F1 lock
bind -n F3 select-pane -t:.+
bind -n F4 select-pane -t:.-
# please refer tmux document
#bind -n F2 up-pane
#bind -n F3 down-pane
bind -n F6 resizep -L 1
bind -n F7 resizep -R 1
bind -n F8 resizep -U 1
bind -n F9 resizep -D 1
## Use h and v for splitting.
unbind %
unbind '"'
bind v split-window -h
bind | split-window -h
bind h split-window -v
bind - split-window -v
# reload config
bind r source-file ~/.tmux.conf
# kill current window
bind-key k confirm kill-window
# last window
unbind l
bind a last-window
# scrollback buffer n lines
set -g history-limit 5000
# on-screen time for display-panes in ms
set -g display-panes-time 2000
# wm window title string (uses statusbar variables)
set -g set-titles-string "tmux:#I #W"
# Mouse mode
# make scrolling with wheels work (tmux 2.1)
# ref: http://stackoverflow.com/questions/11832199/tmux-set-g-mouse-mode-on-doesnt-work
# https://github.com/tmux/tmux/issues/145
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# tmux version under 2.1
# set -g mode-mouse on
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
# set -g mouse-select-window on
# Toggle mouse on
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'