-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
124 lines (92 loc) · 3.81 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
################################################################################
# General
################################################################################
# Decrease the delay between prefix and command
set -s escape-time 1
# Set the index nnumber for windows, panes to 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
# Enable true color and italic font
set -g default-terminal 'screen-256color'
# set -g default-terminal 'xterm-256color'
# set -g default-terminal 'xterm-256color-italic'
# set-option -ga terminal-overrides ',xterm-256color-italic:Tc'
# Use a mouse
set -g mouse on
################################################################################
# Status line
################################################################################
# Update the status line every sixty seconds
set -g status-interval 60
# Show activity alerts
setw -g monitor-activity on
set -g visual-activity on
# Set the status line's colors
set -g status-style fg=white,bg=black
# Set the color of the window list
setw -g window-status-style fg=white,bg=black
# Set colors for the active window
setw -g window-status-current-style fg=white,bold,bg=red
# Show session, window, pane at left side
set -g status-left-length 40
set -g status-left "#[fg=red]S:#S #[fg=blue]W:#I #[fg=yellow]P:#P"
# Show the window list at center
set -g status-justify centre
# Show hostname, time at let side
set -g status-right "#[fg=red]%D %R@#h"
################################################################################
# Pane
################################################################################
# Set colors for pane borders
setw -g pane-border-style fg=white,bg=black
setw -g pane-active-border-style fg=white,bg=yellow
# Let active pane normal, other shaded out
setw -g window-style fg=colour240,bg=colour235
setw -g window-active-style fg=white,bg=black
################################################################################
# Keybindings
################################################################################
# Use ctrl-t as prefix key
set -g prefix C-t
# Free the default prefix keybinding
unbind C-b
# Send ctrl-t to other apps in pressing ctrl-t twice
bind C-t send-prefix
# Reload tmux.conf with prefix R
bind R source-file ~/.tmux.conf \; display 'tmux.conf reloaded!'
# Split panes with |, -
bind | split-window -h
bind - split-window -v
# Move between panes with prefix h, j, k, l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Move between windows, panes with 1 prefix key
bind -r n next-window
bind -r p previous-window
bind -r o select-pane -t :.+
# Resize panes with prefix H, J, K, L
bind -r H resize-pane -L 3
bind -r J resize-pane -D 3
bind -r K resize-pane -U 3
bind -r L resize-pane -R 3
# Use vi like key bindings in copy and choice mode
setw -g mode-keys vi
################################################################################
# Vim-tmux-navigator
################################################################################
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
# bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
# bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
# bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
# bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
# # bind-key -n M-\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l"
# bind-key -T copy-mode-vi M-h select-pane -L
# bind-key -T copy-mode-vi M-j select-pane -D
# bind-key -T copy-mode-vi M-k select-pane -U
# bind-key -T copy-mode-vi M-l select-pane -R
# # bind-key -T copy-mode-vi M-\ select-pane -l