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.conf, with

 bind-key v split-window "vim"

I can launch vim in a split window.

how I can use two keys in a tmux bind-key ?
Example:

 bind-key vG split-window "vim +$"
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You cannot. tmux only allows single-key bindings (either alone, using bind-key -n, or following the prefix key).

However, you might try binding "v" to an invocation of command-prompt:

bind-key v command-prompt "tmux-vim.bash %%"

where tmux-vim.bash looks something like

if [ $1 = "G" ]; then
    tmux split-window "vim +$"
fi

Then, after typing v to get to the command prompt, you would just type "G" and press Enter. "G" would be passed as the argument to tmux-vim.bash, and that script would take care of executing the tmux command you (originally) wanted to associate with "vG".

share|improve this answer
1  
    
You'd think I would have remembered answering that well enough to link to it myself :) –  chepner Jul 10 '12 at 12:32
add comment

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.