-
Notifications
You must be signed in to change notification settings - Fork 14
/
.tmux.conf
127 lines (95 loc) · 3.63 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Change the prefix key to C-j
set -g prefix C-j
# Time when pane number is displayed
set -g display-panes-time 5000
# When you start tmux, start zsh
set-option -g default-shell /bin/zsh
set-option -g default-command /bin/zsh
# Emacs keybinding command prompt (C-j + :)
set -g status-keys emacs
# Focus on terminal events
set -g focus-events on
# Reduce keystroke delay
set -sg escape-time 1
# Start window index from 1
set -g base-index 1
# Start the index of the pane from 1
setw -g pane-base-index 1
# | Divides the pane vertically by |
bind | split-window -h
# - Split a pane horizontally
bind - split-window -v
# Move pane
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key 1 select-pane -t 1
bind-key 2 select-pane -t 2
bind-key 3 select-pane -t 3
bind-key 4 select-pane -t 4
bind-key C-g display-panes
# Resize pane
bind -r C-h resize-pane -L 1
bind -r C-l resize-pane -R 1
bind -r C-j resize-pane -D 1
bind -r C-k resize-pane -U 1
# Enable mouse operation
setw -g mouse
# Set scroll baffer
set -g history-limit 10000
# Set title
set -g set-titles on
set -g set-titles-string "Terminal"
# Use 256 color terminal
#set -g default-terminal "xterm"
#set -g default-terminal "tmux-256color"
set -g default-terminal "screen-256color"
# Override terminal emulator setting
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
set -ga terminal-override ',rxvt-uni*:XT:Ms=\E]52;%p1%s;%p2%s\007'
# 24 bit color for tarmite
set -ga terminal-overrides ",xterm-termite:Tc"
# Interval for updating the status line
set-option -g status-interval 5
# Specify the background color of the status line
set-option -g status-bg "colour238"
# Specify the character color of status line
set-option -g status-fg "colour255"
# Specify the maximum length of status-left
set-option -g status-left-length 20
# Specify the format of status-left
set-option -g status-left "#[fg=colour255,bg=colour238]#{?client_prefix,#[reverse],} Session: #S #[default]"
# Specify the maximum length of status-right
set-option -g status-right-length 60
# Specify the format of status-right
set-option -g status-right "#[fg=colour255,bg=colour238] #h LoadAverage: #(cut -d' ' -f-3 /proc/loadavg) #[default]"
# Specify the format of window-status
set-window-option -g window-status-format " #I: #W "
# Specify the format of the window-status of the current window
set-window-option -g window-status-current-format "#[fg=colour255,bg=colour63,bold] #I: #W #[default]"
# Clipboard synchronization
unbind -T copy-mode M-w
unbind -T copy-mode C-w
bind-key -T copy-mode M-w send -X copy-pipe "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key -T copy-mode C-w send -X copy-pipe "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key C-y run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
# Keybinding in copy so that both vi emac can be used
bind-key -Tcopy-mode j send -X cursor-down
bind-key -Tcopy-mode k send -X cursor-up
bind-key -Tcopy-mode h send -X cursor-right
bind-key -Tcopy-mode l send -X cursor-left
# It shines like a screen when in copy mode
bind-key [ copy-mode \; display "(Copy mode)"
bind-key Escape copy-mode \; display "(Copy mode)"
set-option -g display-time 800
set-option -g message-style bg="colour63"
set-option -g message-style fg="white"
# Draw a helm-like man page
bind-key m command-prompt -p "man:" "split-window -v 'exec man %%'"
# Same as C-x-i of emacs which pour the file
bind-key i command-prompt -p "(load-and-paste) file?" "load-buffer %%" \; paste-buffer
bind-key I command-prompt -p "(load-buffer) file?" "load-buffer %%"
# Set the color of the pane border
set -g pane-active-border-style fg=white
set -g pane-border-style fg=white