title: Cross compatible tmux configuration for vi mode
body: <p>I have the following in my <code>~/.tmux.conf</code> file</p>
  
  <pre><code># improved (vi) copy paste
  #
  # vi mode in tmux
  setw -g mode-keys vi
  bind-key -t vi-copy y copy-selection
  # select entire line
  bind-key -t vi-copy v select line
  </code></pre>
  
  <p>Up till today this has always worked perfectly, problem is I've updated to the latest version :(.</p>
  
  <p><code>tmux -V</code> shows me that I'm currently at version 2.4</p>
  
  <p>The <code>vi-copy</code> bindings are not working anymore. It seems that vi-copy mode is broken. If I execute the following:</p>
  
  <pre><code>CTRL+&lt;leader&gt; :list-keys -t vi-copy
  </code></pre>
  
  <p>The output is:</p>
  
  <blockquote>
    <blockquote>
      <p>Unknown key-table vi-copy</p>
    </blockquote>
  </blockquote>
  
  <p>According to <a href="https://github.com/tmux/tmux/issues/592" rel="nofollow">this</a>, it is a known issue</p>
  
  <p>And you now have to do the following (extracted comment from the above link):</p>
  
  <blockquote>
    <p>Basically you now need to bind your key in the copy-mode-vi table now,
    look at how the default key bindings are done with "tmux lsk". For
    your example: bind -Tcopy-mode-vi v send -X begin-selection</p>
  </blockquote>
  
  <p>I'm sharing my tmux configuration across varous PC's, which are running different tmux versions, I hope somebody can explain how a cross compatible tmux configuration can be created, in which I can have the same keybindings and vi mode behaviour.</p>