In tmux, i know we can chain multiple commands to a key by using \; See Here But in vi mode, i want one single key press to go to the beginning of the current line, begin-selection, go to end-of-line, copy-selection.

In tmux.conf if i give the following bind-key -t vi-copy 's' start-of-line \; begin-selection \; end-of-line \; copy-selection \;

It gives me this : 69: usage: bind-key [-cnr] [-t key-table] key command [arguments] error.

Or is there any alternative way to yank the current line in single key.


Unfortunately, the mode-specific bindings (done with -t) currently only support one command at a time. Additionally, the command must be one of the mode-specific commands, not any general tmux command. In the source, the function cmd_bind_key_check limits the non-option arguments to exactly two when using -t: one key and one command; this is why you get the usage message (though the message it not very illuminating).

You can use invoke the copy-end-of-line command to save a couple of keystrokes though. In vi-copy mode: use 0 D instead of 0 Space $ Enter. In emacs-copy mode: C-a C-k instead of C-a C-Space C-e C-w.

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.