From 9f669d69e3f2a74eac494e1327b4fbb1e48acca9 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 4 Jun 2017 19:20:19 +0200 Subject: [PATCH] tmux: fix vim copy bindings for >= v2.4 --- modules/programs/tmux.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/programs/tmux.nix b/modules/programs/tmux.nix index c3921880..9b5898c2 100644 --- a/modules/programs/tmux.nix +++ b/modules/programs/tmux.nix @@ -160,11 +160,12 @@ in { bind s split-window -v -c '#{pane_current_path}' bind v split-window -h -c '#{pane_current_path}' - bind -t vi-copy v begin-selection + bind-key -T copy-mode-vi p send-keys -X copy-pipe-and-cancel "tmux paste-buffer" + bind-key -T copy-mode-vi v send-keys -X begin-selection '' + optionalString stdenv.isLinux '' - bind -t vi-copy y copy-selection + bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel '' + optionalString stdenv.isDarwin '' - bind -t vi-copy y copy-pipe "${pkgs.reattach-to-user-namespace}/bin/reattach-to-user-namespace pbcopy" + bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "${pkgs.reattach-to-user-namespace}/bin/reattach-to-user-namespace pbcopy" ''); };