-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
123 lines (107 loc) · 5.52 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
set -g prefix C-a
set -s focus-events on
set -s escape-time 10
set -sg repeat-time 600
set -g monitor-activity on
set -g visual-activity off
set -g display-panes-time 4000
set -g history-limit 50000
set -g mouse on
set -g default-terminal "screen-256color"
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
setw -g xterm-keys on
setw -qg utf8 on
tmux_conf_new_window_retain_current_path=false
tmux_conf_new_pane_retain_current_path=true
tmux_conf_new_pane_reconnect_ssh=false
tmux_conf_new_session_prompt=false
set-option -g default-shell /bin/zsh
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
bind-key -n C-k send-keys -R \; send-keys C-l \; send-keys C-? \; clear-history
bind -n C-Up send-keys -R \; send-keys C-l \; send-keys C-? \; clear-history
bind C-c new-session
bind-key -r i run-shell "tmux neww ~/.dotfiles/zsh/config/tmux-node-debugger.sh"
bind-key -n C-f run-shell "tmux neww ~/.dotfiles/zsh/config/tmux-sessionizer.sh"
bind-key -n C-e run-shell "rm /tmp/tmux.log" \;\
run-shell "tmux capture-pane -pJ -S- -E-|sed -E 's| *$||' >/tmp/tmux.log" \;\
neww bash -ic "nvim -u ~/.config/nvim/init.lua /tmp/tmux.log"
# neww bash -c "less -RNs /tmp/tmux.log"
# pipe-pane -o 'cat >>/tmp/tmux.log' \;\
bind - split-window -v # split current window horizontally
bind / split-window -h # split current window vertically
bind f switch-client -l # switch to last session
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
unbind n
unbind p
bind -r C-h previous-window # select previous window
bind -r C-l next-window # select next window
bind -r Left previous-window # select previous window
bind -r Right next-window # select next window
bind -r @ "join-pane -s !"
bind Tab last-window # move to last active window
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
bind Enter copy-mode # enter copy mode
# copy to macOS clipboard
if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | pbcopy"'
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# copy to X11 clipboard
if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
run -b 'tmux bind -t vi-choice h tree-collapse 2> /dev/null || true'
run -b 'tmux bind -t vi-choice l tree-expand 2> /dev/null || true'
run -b 'tmux bind -t vi-choice K start-of-list 2> /dev/null || true'
run -b 'tmux bind -t vi-choice J end-of-list 2> /dev/null || true'
run -b 'tmux bind -t vi-choice H tree-collapse-all 2> /dev/null || true'
run -b 'tmux bind -t vi-choice L tree-expand-all 2> /dev/null || true'
run -b 'tmux bind -t vi-choice Escape cancel 2> /dev/null || true'
run -b 'tmux bind -ct vi-edit H start-of-line 2> /dev/null || true'
run -b 'tmux bind -ct vi-edit L end-of-line 2> /dev/null || true'
run -b 'tmux bind -ct vi-edit q cancel 2> /dev/null || true'
run -b 'tmux bind -ct vi-edit Escape cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true'
run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_window_text " #W"
set -g @catppuccin_window_current_text " #T"
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
set -g status on
set -g status-position top
set -qg status-utf8 on
set -g status-interval 10 # redraw status line every 10 seconds
set -g status-style bg=default
set -g status-right-length 100
set -g status-left-length 100
set -g status-left ""
set -gF status-right "#{E:@catppuccin_status_cpu}"
set -ag status-right "#{E:@catppuccin_status_session}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
set -agF status-right "#{E:@catppuccin_status_battery}"
run ~/.config/tmux/plugins/tmux-cpu/cpu.tmux
run ~/.config/tmux/plugins/tmux-battery/battery.tmux