-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_tmux.conf
94 lines (86 loc) · 3.99 KB
/
dot_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
if-shell "[ \"${__is_vm}\" != 1 ] && [ -z \"${SSH_CLIENT}\" ]" {
# prefix=ctrl-j
unbind C-b
set-option -g prefix C-j
set-option -g prefix2 M-/
bind-key C-j send-prefix
bind-key M-/ send-prefix -2
} { #else
# docker or ssh
# prefix=ctrl-b
set-option -g prefix2 M-.
bind-key M-. send-prefix -2
# 外のtmuxでcopy modeできるようにする
set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
}
set-window-option -g xterm-keys on
set-option -g default-terminal "xterm-256color"
bind-key -T copy-mode C-z send-keys -X begin-selection
bind-key -T copy-mode M-Left send-keys -X previous-word
bind-key -T copy-mode M-Right send-keys -X next-word-end
bind-key -T prefix u command-prompt -p "(save buffer)" "save-buffer \"%%%\""
bind-key -T prefix N new-session
bind-key -T prefix Left previous-window
bind-key -T prefix Right next-window
bind-key -T prefix Home new-window
bind-key -T prefix c new-window
if-shell "uname | grep Linux" {
bind-key -T copy-mode Space send-keys -X copy-pipe-and-cancel 'xclip -selection clipboard -i'
bind-key -T prefix y capture-pane -S - \; \
run-shell -b 'tmux capture-pane -p -S - | xclip -selection clipboard -i'\; \
display-message "captured pane"
bind-key -T prefix v \
run-shell 'tmux set-buffer "$(xclip -selection clipboard -o)"' \; \
refresh-client -S \; \
paste-buffer
} {
if-shell "uname | grep MINGW" {
bind-key -T copy-mode Space send-keys -X copy-pipe-and-cancel 'sh -c "iconv -f utf-8 -t cp932 | clip"'
bind-key -T prefix y capture-pane -S - \; \
run-shell -b 'tmux capture-pane -p -S - | iconv -f utf-8 -t cp932 | clip'\; \
display-message "captured pane"
bind-key -T prefix v \
run-shell 'tmux set-buffer "$(powershell -command Get-Clipboard | iconv -f cp932 -t utf-8)"' \; \
refresh-client -S \; \
paste-buffer
} {
# macOS
bind-key -T copy-mode Space send-keys -X copy-pipe-and-cancel 'pbcopy'
bind-key -T prefix y capture-pane -S - \; \
run-shell -b 'tmux capture-pane -p -S - | pbcopy'\; \
display-message "captured pane"
bind-key -T prefix v \
run-shell 'tmux set-buffer "$(pbpaste)"' \; \
refresh-client -S \; \
paste-buffer
}
}
set-option -g status on
set-option -g status-interval 0
set-option -g status-left-length 20
# set-option -g status-right-length 200
set-option -g base-index 1
set-window-option -g pane-base-index 1
set-option -g status-bg "colour223"
set-option -g status-fg "colour0"
set-option -g status-left "#{?client_prefix,#[bg=colour118]#h[#S]#[bg=colour223]#[fg=colour118],#h[#S] }#[default] "
# catなどにpipeしないとwindows版pythonがなぜかInvalid Argumentエラーを出す
# set-option -g status-right "#[fg=colour75]#[bg=colour75,fg=colour228]#(~/.local/share/chezmoi/scripts/tmux.ps.py #{pane_pid} | cat) #[fg=colour177]#[bg=colour177,fg=colour228]#T"
set-option -g status-right "#[fg=colour75]#[bg=colour75,fg=colour228]#{buffer_size} #[fg=colour105]#[bg=colour105,fg=colour228]#{=/20/...:#{buffer_sample}}"
# set-window-option -g window-status-format "(#I:#W#(pgrep -P #{pane_pid} && echo '*'))"
set-window-option -g window-status-format "(#I:#{?#{==:#W,},#{?#{==:#{pane_current_path},#{session_path}},,#{=/10/...:#{b:pane_current_path}}},#W})"
set-window-option -g window-status-current-format "#[fg=colour123]#[bg=colour123,fg=colour0]#I:#{?#{==:#W,},#{?#{==:#{pane_current_path},#{session_path}},,#{=/10/...:#{b:pane_current_path}}},#W}#[bg=colour223,fg=colour123]#[default]"
set-window-option -g automatic-rename on
set-window-option -g automatic-rename-format ''
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'laktak/extrakto'
set-option -g @extrakto_popup_position "R"
set-option -g @extrakto_popup_size "40,7"
set-option -g @extrakto_copy_key "tab"
set-option -g @extrakto_insert_key "enter"
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-save-interval '5'
set -g @resurrect-dir '$HOME/.tmux/resurrect/$HOSTNAME/'
set -g @resurrect-capture-pane-contents 'on'
run '~/.tmux/plugins/tpm/tpm'