-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
118 lines (88 loc) · 4.11 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
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",xterm-256color:Tc"
set -g update-environment 'PATH'
set-window-option -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
set-option -g history-limit 20000
set-option -g default-shell /bin/zsh
set-option -sg escape-time 1
set-option -g set-titles on
set-option -g set-titles-string "tmux: #I #W"
set-option -g focus-events on
set-window-option -g window-active-style bg="terminal"
set-window-option -g window-style bg="#343d46"
# bind Ctrl-j to prefix
set -g prefix C-s
# unbind default prefix
unbind C-b
# pane select
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# bind v split-window -h \; select-layout even-horizontal
# bind s split-window -v \; select-layout even-vertical
bind e setw synchronize-panes on
bind E setw synchronize-panes off
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
bind c new-window -a -c "#{pane_current_path}"
bind N swap-window -t +1\; next-window
bind P swap-window -t -1\; previous-window
setw -g mode-keys vi
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 C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi Escape send-keys -X clear-selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
if-shell -b '[ $(which pbcopy | awk "{print NF}") -eq 1 ]' \
'unbind -T copy-mode-vi Enter;\
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"; \
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy";'
if-shell -b '[ $(which pbcopy | awk "{print NF}") -eq 1 ]' \
'bind-key -T prefix ] run "tmux set-buffer -- \"$(pbpaste)\"; tmux paste-buffer"'
if-shell -b '[ $(which xsel | awk "{print NF}") -eq 1 ]' \
'bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i"; \
bind-key -T prefix ] run "tmux set-buffer -- \"$(xsel -bo)\"; tmux paste-buffer"'
# reload config
bind r source-file ~/.config/tmux/tmux.conf \; display-message -d 500 "tmux.conf reloaded."
# plugins
# set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tpm-sensible'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @resurrect-strategy-vim 'session'
# set -g @resurrect-strategy-nvim 'session'
# set -g @plugin 'tmux-plugins/tmux-continuum'
# set -g @continuum-restore 'on'
# bind-key -T copy-mode-vi C-n page-up
# bind-key -T copy-mode-vi C-f page-down
# bind-key -T copy-mode-vi C-u scroll-up
# bind-key -T copy-mode-vi C-d scroll-down
# bind C-k kill-pane
# This tmux statusbar config was created by tmuxline.vim
# on 木, 06 4月 2023
set -g status-bg "#243945"
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=#d8dee9,bg=#2d4857"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#99c794"
set -g status-style "none,bg=#243945"
set -g message-style "fg=#d8dee9,bg=#2d4857"
set -g pane-border-style "fg=darkgray"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "none"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=#adb5c0,bg=#243945"
set -g status-left "#[fg=#243945,bg=#99c794,bold] #S #[fg=#99c794,bg=#243945,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#2d4857,bg=#243945,nobold,nounderscore,noitalics]#[fg=#d8dee9,bg=#2d4857] %Y-%m-%d %H:%M #[fg=#355466,bg=#2d4857,nobold,nounderscore,noitalics]#[fg=#d8dee9,bg=#355466] #h "
setw -g window-status-format "#[fg=#adb5c0,bg=#243945] #I #[fg=#adb5c0,bg=#243945] #W "
setw -g window-status-current-format "#[fg=#243945,bg=#2d4857,nobold,nounderscore,noitalics]#[fg=#d8dee9,bg=#2d4857] #I #[fg=#d8dee9,bg=#2d4857] #W #[fg=#2d4857,bg=#243945,nobold,nounderscore,noitalics]"
# Initialize tmux plugin manager
# run -b '~/.tmux/plugins/tpm/tpm'