Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
    
Thanks Chiris, thisis a nice compromise. – isomorphismes Sep 25 '14 at 5:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .