-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
executable file
·181 lines (141 loc) · 4.39 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
170
171
172
173
174
175
176
177
178
179
180
181
# Hierarchy:
# Server
# ㄴSession
# ㄴWindow
# ㄴPane
# Options:
# - Session options (set [-g])
# - Window options (setw [-g])
# -------------------------------------------------------------------
# Session options
# -------------------------------------------------------------------
# remap bind key
unbind C-b
unbind %
unbind '"'
set -g prefix C-Space
# default shell
set -g default-command "zsh"
# env
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
# if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
set -g default-terminal "tmux-256color"
# noise
set -g visual-activity on
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
# set -g bell-action none
# escape
set -sg escape-time 10
# change first index
set -g base-index 1
set -g pane-base-index 1
# resize
set -g aggressive-resize on
# Renumber windows when a window is closed
set -g renumber-windows on
# History
set -g history-limit 102400
# Repeat time limit (ms)
set -g repeat-time 500
# Key binding in the status line (bind :)
set -g status-keys emacs
# Mouse
set -g mouse off
# send event when focus changes
set -g focus-events on
# -------------------------------------------------------------------
# Window options
# -------------------------------------------------------------------
# Copy-mode
setw -g mode-keys vi
bind P paste-buffer
bind C copy-mode
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection
bind -T copy-mode-vi r send-keys -X rectangle-toggle
# prefix c
bind c new-window -c "#{pane_current_path}"
# prefix |
bind | split-window -h -c "#{pane_current_path}"
# prefix -
bind - split-window -c "#{pane_current_path}"
# Moving windows
bind -r > swap-window -t :+
bind -r < swap-window -t :-
# rename window
unbind n
bind n command-prompt 'rename-window %%'
# create a window
unbind c
bind c new-window
# window navigation
unbind ,
unbind .
bind , previous-window
bind . next-window
# Pane-Selection
bind h select-pane -L
bind l select-pane -R
bind j select-pane -D
bind k select-pane -U
bind tab select-pane -t :.+
bind btab select-pane -t :.-
# Pane-Movement
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
bind -n M-m resize-pane -Z
# reset
unbind x
bind x select-layout even-vertical
# Synchronize panes
bind * setw synchronize-pane
# Clear scrollback buffer
bind C-l send-keys C-l \; clear-history
# Notes
bind C-n if-shell "tmux select-window -t NOTES" "" \
"new-window -n NOTES nvim ~/.notes; move-window -t 0"
# Goyo
bind G set status
# change kill button
unbind &
bind k killp
# reload config
unbind r
bind r source-file ~/.tmux.conf \; display-message "Reloaded!"
# select window/pane
unbind l
bind l choose-tree
# -------------------------------------------------------------------
# Decoration (256-color)
# -------------------------------------------------------------------
set -g status-justify left
set -g status-left ''
set -g status-left-length 20
set -g status-right-length 50
set -g status-style 'fg=colour137 bg=colour234 dim'
set -g status-right '#{prefix_highlight} #[fg=colour233,bg=colour241,bold] %d/%m/%Y #[fg=colour233,bg=colour245,bold] %H:%M:%S'
set -g status-interval 60
set -g pane-border-status bottom
set -g pane-border-format "#{pane_index} #{pane_current_command}"
set -g pane-border-style "fg=colour238 bg=colour235"
set -g pane-active-border-style "fg=colour51 bg=colour236"
setw -g window-status-style 'fg=colour138 bg=colour235 none'
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
setw -g window-status-current-style 'fg=colour81 bg=colour238 bold'
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
setw -g mode-style 'fg=colour196 bg=colour238 bold'
set -g message-style 'fg=colour232 bg=colour166 bold'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'schasse/tmux-jump'
# install tpm
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'