The QA how to set shortcut for 'copy mode'? explains how to set a shortcut to tmux copy mode. My question is different, I want to change a shortcut within copy mode, in particular copy-mode-vi. This is part of my ~/.tmux.conf where I have set up copy mode:

# Copy paste in tmux based on
# https://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu/
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# Also copy to system clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
# map copy mode to ctrl+alt+c
bind-key -n 'C-M-c' copy-mode
# map paste buffer to ctrl+alt+v
bind-key -n 'C-M-v' paste-buffer

I have my vim normal mode $ mapped to the m key (I use an azerty keyboard). How can I configure tmux's copy-mode-vi in a similar way so that the m moves to the end of line (i.e. $).


You config already seems to have some good examples. Try

bind-key -T copy-mode-vi m send-keys -X end-of-line

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.