/.tmux_conf

My Personal Tmux Configuration with Emacs prefix key that just works (imho the best tmux configuration I think)

Apache License 2.0Apache-2.0

.tmux.conf

My Personal Tmux Configuration with Emacs prefix key that just works (imho the best tmux configuration I think) based on gpakosz/.tmux.conf

Screenshot

Installation

If you want to custmize your tmux.conf ,just touch a file named .tmux.conf.local :

Features

  • prefix key is C-x,which is the same of Emacs prefix key.
  • visual theme inspired by Powerline
  • maximize any pane to a new window with <prefix> +
  • SSH aware username and hostname status line information
  • mouse mode toggle with <prefix> m
  • automatic usage of reattach-to-user-namespace if available
  • laptop battery status line information
  • uptime status line information
  • optional highlight of focused pane (tmux >= 2.1)
  • configurable new windows and panes behavior (optionally retain current path)
  • SSH aware split pane (reconnects to remote server, experimental)
  • copy to OS clipboard (needs reattach-to-user-namespace on macOS, xsel or xclip on Linux)
  • Facebook PathPicker integration if available
  • Urlview integration if available

Maximize pane

Mouse mode allows you to set the active window, set the active pane, resize panes and automatically switches to copy-mode to select text.

Mouse mode

Common key-bindings:

  • <prefix> e opens ~/.tmux.conf.local with the editor defined by the $EDITOR environment variable (defaults to vim when empty)

  • <prefix> r reloads the configuration

  • C-l clears both the screen and the tmux history

  • <prefix> C-c creates a new session

  • <prefix> c creates a new panel

  • <prefix> o exchange panels

  • <prefix> C-f lets you switch to another session by name

  • <prefix> C-h and <prefix> C-l let you navigate windows (default <prefix> n and <prefix> p are unbound)

  • <prefix> Tab brings you to the last active window

  • <prefix> / splits the current pane vertically

  • <prefix> - splits the current pane horizontally

  • <prefix> h, <prefix> j, <prefix> k and <prefix> l let you navigate panes ala Vim

  • <prefix> H, <prefix> J, <prefix> K, <prefix> L let you resize panes

  • <prefix> < and <prefix> > let you swap panes

  • <prefix> + maximizes the current pane to a new window

  • <prefix> m toggles mouse mode on or off

  • <prefix> U launches Urlview (if available)

  • <prefix> F launches Facebook PathPicker (if available)

  • <prefix> Enter enters copy-mode

  • <prefix> b lists the paste-buffers

  • <prefix> p pastes from the top paste-buffer

  • <prefix> P lets you choose the paste-buffer to paste from

Enabling the Powerline look

Powerline originated as a status-line plugin for Vim. Its popular eye-catching look is based on the use of special symbols: Powerline Symbols

To make use of these symbols, there are several options:

Please see the Powerline manual for further details.

Then edit the ~/.tmux.conf.local file (<prefix> e) and adjust the following variables:

tmux_conf_theme_left_separator_main=''
tmux_conf_theme_left_separator_sub=''
tmux_conf_theme_right_separator_main=''
tmux_conf_theme_right_separator_sub=''

Configuring the status line

Contrary to the first iterations of this configuration, by now you have total control on the content and order of status-left and status-right.

Edit the ~/.tmux.conf.local file (<prefix> e) and adjust the tmux_conf_theme_status_left and tmux_conf_theme_status_right variables to your own preferences.

This configuration supports the following builtin variables:

  • #{battery_bar}: horizontal battery charge bar
  • #{battery_percentage}: battery percentage
  • #{battery_status}: is battery charging or discharging?
  • #{battery_vbar}: vertical battery charge bar
  • #{circled_session_name}: circled session number, up to 20
  • #{hostname}: SSH aware hostname information
  • #{hostname_ssh}: SSH aware hostname information, blank when no SSH connection detected
  • #{loadavg}: load average
  • #{pairing}: is session attached to more than one client?
  • #{prefix}: is prefix being depressed?
  • #{root}: is current user root?
  • #{uptime_d}: uptime days
  • #{uptime_h}: uptime hours
  • #{uptime_m}: uptime minutes
  • #{uptime_s}: uptime seconds
  • #{username}: SSH aware username information
  • #{username_ssh}: SSH aware username information, blank when no SSH connection detected