Productivity

Splitting a terminal into smaller windows (tmux)

tmux is a terminal multiplexer, similar to GNU Screen, but arguably better.

Some tips:

  • The default keybindings let you use ^b arrow to move between panes. However, because this is a sequence of keys rather than a modifier, you can easily get into timing issues where you meant to move to the pane above, then downward in the open file, but actually moved to the pane above and back into the previous one. You can fix this by telling tmux to not wait for commands:

    set -g escape-time 0
    
  • You can bind a key to take the current tmux selection and put it in the X11 clipboard:

    unbind ^C
    bind ^C run "tmux show-buffer | xclip -i -selection clipboard"
    

    Using the standard keybindings, you would hit:

    1. ^b^[ to enter copy mode
    2. ^space to mark the beginning of a selection
    3. arrow keys to mark the end
    4. Alt-w to select

    Then press ^b^c to copy that text to the X11 clipboard.