-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjunegunn.tmux.conf
198 lines (161 loc) · 6.75 KB
/
junegunn.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Hierarchy:
# Server
# ㄴSession
# ㄴWindow
# ㄴPane
# Options:
# - Session options (set-option [-g])
# - Window options (set-window-option [-g])
# -------------------------------------------------------------------
# Session options
# -------------------------------------------------------------------
# Change bind key to ctrl-a
unbind-key c-b
set-option -g prefix c-a
set -sg escape-time 1
bind C-a send-prefix
# Index starts from 1
set-option -g base-index 1
set-option -g pane-base-index 1
# Renumber windows when a window is closed
set-option -g renumber-windows on
# History
set-option -g history-limit 102400
# Repeat time limit (ms)
set-option -g repeat-time 500
# 256-color terminal
set-option -g default-terminal "screen-256color"
# Sierra
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Add truecolor support (tmux info | grep Tc)
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Key binding in the status line (bind-key :)
set-option -g status-keys emacs
# Mouse
set-option -g mouse on
# -------------------------------------------------------------------
# Window options
# -------------------------------------------------------------------
# Copy-mode
set-window-option -g mode-keys vi
# -------------------------------------------------------------------
# Key bindings
# -------------------------------------------------------------------
# prefix c
bind-key c new-window -c "#{pane_current_path}"
# prefix ctrl-a
bind-key c-a last-window
# prefix a
bind-key a send-prefix
# prefix |
bind-key | split-window -h -c "#{pane_current_path}"
# prefix -
bind-key - split-window -c "#{pane_current_path}"
# Moving windows
bind-key -r > swap-window -t :+
bind-key -r < swap-window -t :-
# Back and forth
bind-key bspace previous-window
bind-key space next-window
bind-key / next-layout # Overridden
# Pane-movement
bind-key h select-pane -L
bind-key l select-pane -R
bind-key j select-pane -D
bind-key k select-pane -U
bind-key tab select-pane -t :.+
bind-key btab select-pane -t :.-
# Synchronize panes
bind-key * set-window-option synchronize-pane
# Reload ~/.tmux.conf
bind-key R source-file ~/.tmux.conf \; display-message "Reloaded!"
# copy-mode
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key y send-keys C-l C-a \; run-shell 'sleep 0.25' \;\
copy-mode \; send-keys -X begin-selection \;\
send-keys -X -N 100 'cursor-down' \;\
send-keys -X 'end-of-line' \;\
send-keys -X 'previous-word' \;\
send-keys -X 'next-word-end' \;\
send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" \;\
send-keys C-e \;\
display-message "Line copied"
# Capture pane and open in Vim
bind-key C-c run 'FILE=/tmp/tmux-capture-$(date +%Y%m%d%H%M%S).txt; tmux capture-pane -J -S -102400 -p > $FILE; tmux new-window "reattach-to-user-namespace vim $FILE"'
bind-key C-w run "screencapture -l$(osascript -e 'tell app \"iTerm\" to id of window 1') -x -o -P /tmp/$(date +%Y%m%d-%H%M%S).png"
# Clear scrollback buffer
bind-key C-l send-keys C-l \; clear-history
# Notes
bind-key C-n if-shell "tmux select-window -t NOTES" "" \
"new-window -n NOTES 'reattach-to-user-namespace bash -i ~/.list'; move-window -t 0" \
# Goyo
bind-key G set status
# -------------------------------------------------------------------
# Decoration (256-color)
# -------------------------------------------------------------------
set-option -g status-justify left
set-option -g status-left '#[bg=colour72] #[bg=colour237] #[bg=colour236] #[bg=colour235]#[fg=colour185] #h #[bg=colour236] '
set-option -g status-left-length 16
set-option -g status-bg colour237
set-option -g status-right '#[bg=colour236] #[bg=colour235]#[fg=colour185] #(date "+%a %b %d %H:%M") #[bg=colour236] #[bg=colour237] #[bg=colour72] '
set-option -g status-interval 60
set-option -g pane-border-status bottom
set-option -g pane-border-format "#{pane_index} #{pane_current_command}"
#set-option -g pane-active-border-fg colour245
#set-option -g pane-border-fg colour243
set-window-option -g window-status-format '#[bg=colour238]#[fg=colour107] #I #[bg=colour239]#[fg=colour110] #[bg=colour240]#W#[bg=colour239]#[fg=colour195]#F#[bg=colour238] '
set-window-option -g window-status-current-format '#[bg=colour236]#[fg=colour215] #I #[bg=colour235]#[fg=colour167] #[bg=colour234]#W#[bg=colour235]#[fg=colour195]#F#[bg=colour236] '
# set-window-option -g window-style 'bg=colour238'
# set-window-option -g window-active-style 'bg=colour237'
# -------------------------------------------------------------------
# fzf integration
# -------------------------------------------------------------------
# Tmux completion
bind-key -n 'M-t' run "tmux split-window -p 40 'tmux send-keys -t #{pane_id} \"$(tmuxwords.rb --all --scroll 1000 --min 5 | fzf --multi | paste -sd\\ -)\"'"
# fzf-locate (all)
bind-key -n 'M-`' run "tmux split-window -p 40 'tmux send-keys -t #{pane_id} \"$(locate / | fzf -m | paste -sd\\ -)\"'"
# select-pane (@george-b)
bind-key 0 run "tmux split-window -l 12 'bash -ci ftpane'"
# -------------------------------------------------------------------
# Here be dragons!
# -------------------------------------------------------------------
# Backslash bind-key
if-shell "test $USER = jg" \
"unbind C-a; set-option -g prefix \\ ; bind-key ] send-prefix; bind-key p paste-buffer; bind-key \\ last-window"
# Bind-key switch
bind-key F9 set-option -g prefix C-a \;\
bind-key a send-prefix \;\
bind-key p previous-window \;\
bind-key C-a last-window
bind-key F10 set-option -g prefix "\\" \;\
bind-key ] send-prefix \;\
bind-key p paste-buffer \;\
bind-key "\\" last-window
# TPM
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'junegunn/tmux-fzf-url'
set -g @plugin 'caiogondim/maglev'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'chriszarate/tmux-tasks'
set -g @plugin 'xamut/tmux-network-bandwidth'
set -g @plugin 'xamut/tmux-weather'
#theme
set -g @plugin 'jimeh/tmux-themepack'
#set -g @plugin 'sei40kr/tmux-airline-dracula'
#set -g @plugin 'arcticicestudio/nord-tmux'
#set -g @plugin 'jooize/tmux-powerline-theme'
#set -g @plugin 'srcery-colors/srcery-tmux'
#set -g @plugin 'mkoga/tmux-solarized'
#set -g @plugin 'logico-software/typewriter-tmux'
source ~/.tmux/customs/colorcli.tmux.conf
run '~/.tmux/plugins/tpm/tpm'
#run-shell "~/data/data/.runtime/typewriter/typewriter-tmux/nord.tmux"