-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.tmux.conf
169 lines (137 loc) · 4.79 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Release all key bind
unbind-key Up
unbind-key Down
unbind-key Left
unbind-key Right
unbind-key S-Up
unbind-key S-Down
unbind-key S-Left
unbind-key S-Right
unbind-key C-Up
unbind-key C-Down
unbind-key C-Left
unbind-key C-Right
# Prefix key is [Ctrl+t]
set -g prefix C-g
# Escape time dilay [-1]
set -sg escape-time 1
# Start number of window index is [1]
set -g base-index 1
# Start number of pain index is [1]
setw -g pane-base-index 1
# Reload config
bind-key r source-file ~/.tmux.conf \; display "Reloaded!"
# Open new window
bind-key Enter new-window -c "#{pane_current_path}"
bind-key -n M-Enter new-window -c "#{pane_current_path}"
# Split Window
bind-key s split-window -v -c "#{pane_current_path}"
# Vertical Split Window
bind-key v split-window -h -c "#{pane_current_path}"
# Move(Select) pain
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 -n M-h select-pane -L
bind-key -n M-j select-pane -D
bind-key -n M-k select-pane -U
bind-key -n M-l select-pane -R
# Resize pain
bind-key H resize-pane -L 5
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key L resize-pane -R 5
bind-key -n M-H resize-pane -L 5
bind-key -n M-J resize-pane -D 5
bind-key -n M-K resize-pane -U 5
bind-key -n M-L resize-pane -R 5
# Move(Select) window
bind-key n select-window -n
bind-key p select-window -p
bind-key -n M-n select-window -n
bind-key -n M-p select-window -p
# Jump(Select) window
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
# Switch(Swap) window
bind-key 1 swap-window -t 1
bind-key 2 swap-window -t 2
bind-key 3 swap-window -t 3
bind-key 4 swap-window -t 4
bind-key 5 swap-window -t 5
bind-key 6 swap-window -t 6
bind-key 7 swap-window -t 7
bind-key 8 swap-window -t 8
bind-key 9 swap-window -t 9
# Toggle Window
bind-key Tab last-window
bind-key -n M-Tab last-window
# Change layout(Select layout) pane
bind-key -n C-Up select-layout even-horizontal
bind-key -n C-Down select-layout main-horizontal
bind-key -n C-Left select-layout even-vertical
bind-key -n C-Right select-layout main-vertical
# Switch(Swap) Window
bind-key -n S-Left swap-window -t -1 \; select-window -p
bind-key -n S-Right swap-window -t +1 \; select-window -n
# Move(Switch) session
bind-key N switch-client -n
bind-key P switch-client -p
bind-key -n M-N switch-client -n
bind-key -n M-P switch-client -p
# Enter copy mode
set -s set-clipboard on
bind-key -n M-[ copy-mode -e
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy && wl-paste -n | wl-copy -p"
# Reanme session
bind-key R command-prompt -I "#S" "rename-session '%%'"
# Key bind kill current pane
bind-key q kill-pane
bind-key -n M-q kill-pane
# Key bind kill current window
bind-key x confirm-before -p "kill-window #W? (y/n)" kill-window
bind-key X kill-window
# Key bind kill current session
bind-key d confirm-before -p "kill-session #S? (y/n)" kill-session
bind-key D kill-session
# Mouse control on
setw -g mouse on
# Corlor settings
# https://github.com/morhetz/gruvbox
set -g default-terminal "screen-256color"
set -g status-style "bg=#3c3836,fg=#ebdbb2" # bg1, fg1
set -g status-left-style "bg=#d65d0e,fg=#282828" # orange, bg
set -g status-right-style "bg=#d65d0e,fg=#282828" # orange, fg4
setw -g window-status-style "bg=#665c54,fg=#bdae93" # bg3, fg3
setw -g window-status-current-style "bg=#8ec07c,fg=#282828" # aqua, bg
setw -g window-status-activity-style "bg=#fb4934,fg=#bdae93" # red, fg3
setw -g window-status-bell-style "bg=#fabd2f,fg=#bdae93" # yellow, fg3
setw -g pane-border-style "bg=black,fg=white"
setw -g pane-active-border-style "bg=blue,fg=white"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Left status bar display setting
set -g status-interval 1
set -g status-left-length 128
set -g status-left " session: #{session_name} [#{session_windows}] "
# Right status bar display setting
set -g status-right-length 60
set -g status-right " %Y/%m/%d(%a) %H:%M "
# Window display setting
setw -g window-status-format \
' #{window_index}: #(${HOME}/.tmux/tmux-window-status.sh #{pane_current_path} #{window_name}) #{?#{m:#W,nvim},#[bg=#504945] ,}'
setw -g window-status-current-format \
' #{window_index}: #(${HOME}/.tmux/tmux-window-status.sh #{pane_current_path} #{window_name}) #{?#{m:#W,nvim},#[bg=#928384] ,}'
# # Load OS specific settings
# if-shell 'test "$(uname -s)" = Darwin' "source-file ~/.dotfiles/.tmux.conf.osx"
# if-shell 'test "$(uname -s)" = Linux' "source-file ~/.dotfiles/.tmux.conf.linux"