mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
chore(config): update desktop bindings, tmux keybindings, and MIME associations
This commit is contained in:
1 parent
4768ec30f8
commit
2974f6eb5b
5 files changed
+116
-135
No files matched your search
+101
-130
@@ -1,135 +1,106 @@
|
||||
# ── Plugins ──────────────────────────────────────────────────────────────
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'vaaleyard/tmux-dotbar'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
|
||||
set -g @plugin 'omerxx/tmux-sessionx'
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum' # keep last
|
||||
set -g @plugin 'eduwass/tmux-palette'
|
||||
# Prefix
|
||||
set -g prefix C-Space
|
||||
set -g prefix2 C-b
|
||||
bind -N "Send prefix" C-Space send-prefix
|
||||
|
||||
# ── Kitty compatibility ──────────────────────────────────────────────────
|
||||
set-option -g renumber-windows on
|
||||
# Config and help
|
||||
bind -N "Reload configuration" q source-file ~/.config/tmux/tmux.conf \; display "Configuration reloaded"
|
||||
bind -N "Show Tmux keybindings" ? display-popup -E -w 80% -h 70% -T "Tmux keybindings" "omarchy-menu-tmux-keybindings --print | less -R"
|
||||
|
||||
# Vi mode for copy
|
||||
setw -g mode-keys vi
|
||||
bind -N "Begin selection" -T copy-mode-vi v send -X begin-selection
|
||||
bind -N "Copy selection" -T copy-mode-vi y send -X copy-selection-and-cancel
|
||||
|
||||
# Pane Controls
|
||||
bind -N "Split pane vertically" -n M-Enter split-window -v -c "#{pane_current_path}"
|
||||
bind -N "Split pane horizontally" -n M-S-Enter split-window -h -c "#{pane_current_path}"
|
||||
bind -N "Kill pane" -n M-Escape kill-pane
|
||||
|
||||
bind -N "Split pane vertically" h split-window -v -c "#{pane_current_path}"
|
||||
bind -N "Split pane horizontally" v split-window -h -c "#{pane_current_path}"
|
||||
bind -N "Kill pane" x kill-pane
|
||||
|
||||
bind -N "Focus pane left" -n C-M-Left select-pane -L
|
||||
bind -N "Focus pane right" -n C-M-Right select-pane -R
|
||||
bind -N "Focus pane up" -n C-M-Up select-pane -U
|
||||
bind -N "Focus pane down" -n C-M-Down select-pane -D
|
||||
|
||||
bind -N "Resize pane left" -n C-M-S-Left resize-pane -L 5
|
||||
bind -N "Resize pane down" -n C-M-S-Down resize-pane -D 5
|
||||
bind -N "Resize pane up" -n C-M-S-Up resize-pane -U 5
|
||||
bind -N "Resize pane right" -n C-M-S-Right resize-pane -R 5
|
||||
|
||||
# Window navigation
|
||||
bind -N "Rename window" r command-prompt -I "#W" "rename-window -- '%%'"
|
||||
bind -N "Create window" c new-window -c "#{pane_current_path}"
|
||||
bind -N "Kill window" k kill-window
|
||||
|
||||
bind -N "Switch to window 1" -n M-1 select-window -t 1
|
||||
bind -N "Switch to window 2" -n M-2 select-window -t 2
|
||||
bind -N "Switch to window 3" -n M-3 select-window -t 3
|
||||
bind -N "Switch to window 4" -n M-4 select-window -t 4
|
||||
bind -N "Switch to window 5" -n M-5 select-window -t 5
|
||||
bind -N "Switch to window 6" -n M-6 select-window -t 6
|
||||
bind -N "Switch to window 7" -n M-7 select-window -t 7
|
||||
bind -N "Switch to window 8" -n M-8 select-window -t 8
|
||||
bind -N "Switch to window 9" -n M-9 select-window -t 9
|
||||
|
||||
bind -N "Previous window" -n M-Left select-window -t -1
|
||||
bind -N "Next window" -n M-Right select-window -t +1
|
||||
bind -N "Move window left" -n M-S-Left swap-window -t -1 \; select-window -t -1
|
||||
bind -N "Move window right" -n M-S-Right swap-window -t +1 \; select-window -t +1
|
||||
|
||||
# Session controls
|
||||
bind -N "Rename session" R command-prompt -I "#S" "rename-session -- '%%'"
|
||||
bind -N "Create session" C new-session -c "#{pane_current_path}"
|
||||
bind -N "Kill session" K kill-session
|
||||
bind -N "Previous session" P switch-client -p
|
||||
bind -N "Next session" N switch-client -n
|
||||
|
||||
bind -N "Previous session" -n M-Up switch-client -p
|
||||
bind -N "Next session" -n M-Down switch-client -n
|
||||
|
||||
# General
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -ag terminal-overrides ",*:RGB"
|
||||
set -g mouse on
|
||||
set -g base-index 1
|
||||
setw -g pane-base-index 1
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -ga terminal-overrides ",xterm-kitty:Tc"
|
||||
set -as terminal-features ",xterm-kitty:RGB:usstyle:hyperlinks:clipboard:extkeys"
|
||||
set -g extended-keys always
|
||||
set -gq extended-keys-format csi-u
|
||||
set-option -g status-position top
|
||||
set -g renumber-windows on
|
||||
set -g history-limit 50000
|
||||
set -g escape-time 0
|
||||
set -g focus-events on
|
||||
set -g set-clipboard on
|
||||
set -g allow-passthrough on
|
||||
setw -g aggressive-resize on
|
||||
set -g detach-on-destroy off
|
||||
set -g extended-keys on
|
||||
set -g extended-keys-format csi-u
|
||||
set -ag terminal-features "xterm-kitty:extkeys"
|
||||
set -as terminal-features ",*:clipboard"
|
||||
set -sg escape-time 10
|
||||
|
||||
# ── Status bar ─────────────────────────────────────────────────────────────────
|
||||
# Dotbar
|
||||
set -g @tmux-dotbar-position top
|
||||
set -g @tmux-dotbar-session-position "right"
|
||||
set -g @tmux-dotbar-rounded true
|
||||
set -g @tmux-dotbar-bg "#0B0E14"
|
||||
set -g @tmux-dotbar-fg "#475266"
|
||||
set -g @tmux-dotbar-fg-current "#BFBDB6"
|
||||
set -g @tmux-dotbar-fg-session "#565B66"
|
||||
set -g @tmux-dotbar-fg-prefix "#95E6CB"
|
||||
set -g @tmux-dotbar-justify "absolute-centre"
|
||||
set -g @tmux-dotbar-left "true"
|
||||
set -g @tmux-dotbar-right "false"
|
||||
set -g @tmux-dotbar-session-position "left"
|
||||
set -g @tmux-dotbar-session-text " "
|
||||
set -g @tmux-dotbar-status-right-text " %H:%M "
|
||||
set -g @tmux-dotbar-window-status-format " #W "
|
||||
set -g @tmux-dotbar-window-status-separator " • "
|
||||
set -g @tmux-dotbar-maximized-icon ""
|
||||
set -g @tmux-dotbar-show-maximized-icon-for-all-tabs false
|
||||
set -g @tmux-dotbar-bold-status false
|
||||
set -g @tmux-dotbar-bold-current-window false
|
||||
set -g @tmux-dotbar-ssh-enabled true
|
||||
set -g @tmux-dotbar-ssh-icon ''
|
||||
set -g @tmux-dotbar-ssh-icon-only false
|
||||
# Status bar
|
||||
set -g status-position top
|
||||
set -g status-interval 5
|
||||
set -g status-left-length 30
|
||||
set -g status-right-length 50
|
||||
set -g window-status-separator ""
|
||||
set -gw automatic-rename on
|
||||
set -gw automatic-rename-format '#{b:pane_current_path}'
|
||||
set -g set-titles on
|
||||
set -g set-titles-string '#h:#W'
|
||||
|
||||
# Styling
|
||||
set -g status-style fg=default,bg=default
|
||||
set -g popup-style 'bg=default'
|
||||
set -g popup-border-style 'bg=default,fg=#5c5c66'
|
||||
set -g popup-border-lines rounded
|
||||
set -g @sessionx-additional-options "--color 'bg:-1,bg+:-1,gutter:-1,border:-1,preview-bg:-1'"
|
||||
|
||||
# Kitty graphics protocol passthrough (yazi / image preview)
|
||||
set -g allow-passthrough on
|
||||
set -ga update-environment TERM
|
||||
set -ga update-environment TERM_PROGRAM
|
||||
|
||||
# ── Clipboard (Wayland / Niri) ───────────────────────────────────────────
|
||||
set -g set-clipboard on # OSC 52 — covers ssh'd sessions
|
||||
set -g mouse on
|
||||
setw -g mode-keys vi
|
||||
bind -T copy-mode-vi v send -X begin-selection
|
||||
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "wl-copy"
|
||||
bind -T copy-mode-vi Y send -X copy-pipe-and-cancel "wl-copy" \; send -X cancel
|
||||
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "wl-copy"
|
||||
|
||||
# ── Sessions ─────────────────────────────────────────────────────────────
|
||||
|
||||
set -g @resurrect-strategy-nvim 'session'
|
||||
set -g @resurrect-capture-pane-contents 'on'
|
||||
set -g @resurrect-processes 'ssh psql mysql sqlite3 purple lazygit lazydocker "claude->claude --continue" opencode'
|
||||
set -g @continuum-save-interval '10'
|
||||
set -g @continuum-restore 'off' # restore is owned by kitty-tmux launcher
|
||||
set -g @sessionx-bind 'o'
|
||||
set -g @sessionx-zoxide-mode 'on'
|
||||
|
||||
# ── Titles → Niri active window ──────────────────────────────────────────
|
||||
|
||||
set-option -g set-titles on
|
||||
set-option -g set-titles-string "#T (#S)"
|
||||
set-option -g status-interval 1
|
||||
set-window-option -g automatic-rename on
|
||||
|
||||
# ── QoL ──────────────────────────────────────────────────────────────────
|
||||
set -g history-limit 50000
|
||||
set -g base-index 1
|
||||
setw -g pane-base-index 1
|
||||
set -g renumber-windows on
|
||||
|
||||
# ── Keybinds ─────────────────────────────────────────────────────────────
|
||||
bind -n S-Enter send-keys Escape '[13;2u'
|
||||
# New window: on @ssh_host sessions (set by the Vicinae tmux-sessions
|
||||
# extension) connect to the same remote; otherwise inherit the local cwd.
|
||||
# The remote host is read at runtime — tmux does NOT format-expand a
|
||||
# new-window shell-command, so "#{@ssh_host}" there would be taken literally.
|
||||
bind-key t if-shell -F '#{@ssh_host}' \
|
||||
'new-window "ssh $(tmux show-options -v @ssh_host)"' \
|
||||
'new-window -c "#{pane_current_path}"'
|
||||
bind-key [ previous-window
|
||||
bind-key ] next-window
|
||||
bind-key H previous-window
|
||||
bind-key L next-window
|
||||
set -g @palette-key 'C-Space' # optional, default: C-Space (no-prefix)
|
||||
set -g @palette-find-pane-key 'M-f' # optional, no binding by default
|
||||
set -g @palette-move-pane-key 'M-m' # optional, no binding by default
|
||||
|
||||
|
||||
# Splits inherit cwd (kitty super+t / super+n land here)
|
||||
# vsplit: new pane right at 35% width · hsplit: new pane below at 25% height
|
||||
bind % split-window -h -l 30% -c "#{pane_current_path}"
|
||||
bind '"' split-window -v -l 25% -c "#{pane_current_path}"
|
||||
|
||||
# Copy-mode entry (default prefix+[ is rebound above)
|
||||
bind Escape copy-mode
|
||||
|
||||
# ── Pane navigation: ctrl+hjkl, no prefix ────────────────────────────────
|
||||
# Vim-aware: if the pane runs (n)vim, forward the key so vim handles its
|
||||
# own window movement (pair with vim-tmux-navigator in AstroNvim).
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
|
||||
bind -n C-h if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
|
||||
bind -n C-j if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
|
||||
bind -n C-k if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
|
||||
bind -n C-l if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
|
||||
# Same nav from inside copy-mode
|
||||
bind -T copy-mode-vi C-h select-pane -L
|
||||
bind -T copy-mode-vi C-j select-pane -D
|
||||
bind -T copy-mode-vi C-k select-pane -U
|
||||
bind -T copy-mode-vi C-l select-pane -R
|
||||
# Clear-screen escape hatch (C-l is consumed above)
|
||||
bind C-l send-keys C-l
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
# Theme
|
||||
set -g status-style "bg=default,fg=default"
|
||||
set -g status-left "#[fg=black,bg=blue,bold] #S #[bg=default] "
|
||||
set -g status-right "#[fg=blue]#{?pane_in_mode,COPY ,}#{?client_prefix,PREFIX ,}#{?window_zoomed_flag,ZOOM ,}#[fg=brightblack]#h "
|
||||
set -g window-status-format "#[fg=brightblack] #I:#W "
|
||||
set -g window-status-current-format "#[fg=blue,bold] #I:#W "
|
||||
set -g pane-border-style "fg=brightblack"
|
||||
set -g pane-active-border-style "fg=blue"
|
||||
set -g message-style "bg=default,fg=blue"
|
||||
set -g message-command-style "bg=default,fg=blue"
|
||||
set -g mode-style "bg=blue,fg=black"
|
||||
setw -g clock-mode-colour blue
|
||||
Reference in new issue
Block a user