From 9c9f71f7ff1916fcfbc8de948e093cc528b24c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 2 Feb 2026 10:59:22 +0100 Subject: [PATCH] home/tmux: improve copy mode --- nix/homeModules/common/tmux/tmux.conf | 5 +++++ nix/homeModules/extra/tmux-fish-integration.nix | 1 + 2 files changed, 6 insertions(+) diff --git a/nix/homeModules/common/tmux/tmux.conf b/nix/homeModules/common/tmux/tmux.conf index 2de98a16..33bdd1f6 100644 --- a/nix/homeModules/common/tmux/tmux.conf +++ b/nix/homeModules/common/tmux/tmux.conf @@ -103,5 +103,10 @@ bind -T off F12 \ refresh-client -S # Better copy +# -X flag prevents tmux leaving selection mode, which is jumpy and annoying bind v copy-mode bind -T copy-mode-vi v send-keys -X begin-selection +bind -T copy-mode-vi enter send-keys -X copy-selection +bind -T copy-mode-vi MouseDown1Pane select-pane \; send-keys -X clear-selection +bind -T copy-mode-vi MouseDrag1Pane select-pane \; send-keys -X begin-selection +unbind -T copy-mode-vi MouseDragEnd1Pane diff --git a/nix/homeModules/extra/tmux-fish-integration.nix b/nix/homeModules/extra/tmux-fish-integration.nix index 4480f567..74a6859a 100644 --- a/nix/homeModules/extra/tmux-fish-integration.nix +++ b/nix/homeModules/extra/tmux-fish-integration.nix @@ -29,6 +29,7 @@ programs.tmux.extraConfig = lib.mkBefore '' # sessionizer binds bind -n C-f run-shell "tmux new-window tmux-sessionizer" + bind -T copy-mode-vi C-f run-shell "tmux new-window tmux-sessionizer" ''; home.packages = with pkgs; [