dotfiles/.tmux.conf2
Dict Xiong 3bd0121786
[dev] GPG agent forwarding; improve riot, sagt, tmux and zsh (#46)
* feat(riot): support literal ipv6 addresses (with or without ports given)

feat(riot): -v, -4, and -6

fix(riot): do not call external binaries if possible

* feat(riot): command git

* build(riot-config): nasp.fit -> jump.nasp.fit

* feat: add bnd and nor and completions

* fix(zshrc): bnd exit when build error

* fix(tmux): press ^a twice to send ^a

* feat(riot): sshl supports specifying local port and unix sock

* feat(riot): sshr for ssh -R

* feat(riot): -o ServerAliveInterval=60

* feat(riot): conditionally RequestTTY

* feat: zsh completion for beam and beaml

* fix(frigg): ddns get ip

* fix(riot): tmux error with window number and spaces

The fix to spaces is just a workaround. Issue may still exist when
command contains spaces.

* feat(riot): ControlPersist=60s

* fix(ci): riot

* feat(tmux): prevent tmux from exiting copy mode after selection with mouse

see:
- https://www.reddit.com/r/tmux/comments/v73005/how_to_prevent_tmux_from_exiting_copy_mode_after/
- https://www.reddit.com/r/tmux/comments/1ltms6a/how_to_select_text_in_tmux_without_having_it_jump/

* feat(tmux): F12 to passthru

* fix(riot): ControlPersist 60s -> 5s

* feat: sne: search and edit

* feat(ssh): add key ip17/sep

* feat(tmux): press ESC to exit copy mode

* feat(ssh): add key sk1/piv/9a

* feat(ssh): add key sk1/fido2

* feat(ssh): add key openpgp:0x8774BF70 and remove key ip14/sep and ltp2 (asu127)

* feat(sagent): sagt gpg; improve code

* feat(sagent): check pinentry and give notes

* feat(riot): add GPG agent forwarding

Signed-off-by: Dict Xiong <me@beardic.cn>

* feat: gitconf add gpg signature; remove macos from ci

* feat(eid): add sk1 9a cert

* feat(riot): better help and fix option quite->quiet

* feat(riot): separate command options from riot options

* feat(sagt): gpg-pin and associated tests

* feat(riot): zsh completions

* fix: Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix(riot): simplify and secure

* fix: syntax

---------

Signed-off-by: Dict Xiong <me@beardic.cn>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-13 20:10:55 +08:00

67 lines
2.6 KiB
Plaintext

set -g prefix ^a
bind ^a send-prefix
set -g mouse on
set -g set-clipboard on
set -g default-terminal "xterm-256color"
set -g history-limit 10000
# plugins
set -g @plugin 'https://gitee.com/dictxiong/tmux-mem-cpu-load'
set -g @plugin 'https://gitee.com/dictxiong/tmux-resurrect'
run '~/.tmux/plugins/tpm/tpm'
# Use Alt-arrow keys to switch panes
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
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# '-' and '|' to split
bind - split-window -v -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
# other key bindings
## prefix r: reload conf
bind r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded"
## prefix m: toggle mouse mode
bind m run 'old=$(tmux show -gv mouse); new="off"; if [ "$old" = "off" ]; then new="on"; fi; tmux set -g mouse $new && tmux display-message toggle\ mouse\ mode\ $new'
## prefix C-x: pane sync
bind C-x set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
## prevent jumping to end after mouse selection
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection -x
## F12: passthru
bind -T root F12 set prefix None \; set key-table off \; set status-bg red \; refresh-client -S
bind -T off F12 set -u prefix \; set -u key-table \; set -u status-bg \; refresh-client -S
## ESC: exit copy mode
bind -T copy-mode-vi Escape send-keys -X cancel
# styles
# status bar
set -g monitor-activity on
set -g bell-action any
set -g status-position top
set -g status-style fg=white,bg=colour241
set -g status-interval 1
set -g status-justify centre
set -g status-left-length 23
set -g status-left "#[fg=colour228]#(whoami)#[default]@#(hostname | sed 's/-ibd-ink//g')[#S]"
set -g status-right-length 60
set -g status-right "#[default]#(~/.tmux/plugins/tmux-mem-cpu-load/tmux-mem-cpu-load --averages-count 1 --interval 2)#[default] "
set -ag status-right "#[default]#(uptime | cut -f 4-5 -d ' ' | cut -f 1 -d ',' | sed 's/ //g')"
set -ag status-right " #[fg=white,bg=default]%H:%M:%S"
set -g window-status-style fg=colour248
set -g window-status-current-style fg=colour228,bg=colour237
set -g window-status-activity-style fg=colour237,bg=colour248
set -g window-status-bell-style fg=colour237,bg=colour214
# panes and windows
set -g pane-active-border-style fg=brightblue
set -g window-style fg=colour248
set -g window-active-style fg=white
# better mouse scrolling. see: https://superuser.com/questions/1622812/mouse-scrolling-in-mobaxterm-tmux
set -g terminal-overrides 'xterm*:smcup@:rmcup@'