Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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