Skip to content

pgilad/tmux-sensible

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tmux sensible

A set of tmux options that should be acceptable to everyone.

Inspired by vim-sensible.

Tested and working on Linux, OSX and Cygwin.

Principles

  • tmux-sensible options should be acceptable to every tmux user!
    If any of the options bothers you, please open an issue and it will probably be updated (or removed).
  • if you think a new option should be added, feel free to open a pull request.
  • avoids overriding existing key bindings.
    tmux-sensible only adds bindings that are not already set and keeps option changes focused on tmux defaults and a small set of explicit ergonomics.

Goals

  • group standard tmux community options in one place
  • remove clutter from your .tmux.conf
  • educate new tmux users about basic options

Options

# Address vim mode switching delay for both older and newer tmux defaults
set -s escape-time 0

# Increase scrollback buffer size from 2000 to 50000 lines
set -g history-limit 50000

# Increase tmux messages display duration from 750ms to 4s
set -g display-time 4000

# Refresh 'status-left' and 'status-right' more often, from every 15s to 5s
set -g status-interval 5

# Prefer the native tmux terminfo entry when available
# (falls back to "screen-256color" if "tmux-256color" is not installed)
set -g default-terminal "tmux-256color"

# Focus events enabled for terminals that support them
set -g focus-events on

Key bindings

# Easier and faster switching between next/prev window
bind C-p previous-window
bind C-n next-window

Above bindings enhance the default prefix + p and prefix + n bindings by allowing you to hold Ctrl and repeat a + p/a + n (if your prefix is C-a), which is a lot quicker.

# Source ~/.config/tmux/tmux.conf when present, otherwise ~/.tmux.conf
bind R source-file '~/.config/tmux/tmux.conf'

"Adaptable" key bindings that build upon your prefix value:

# If prefix is 'C-a'
bind C-a send-prefix
bind a last-window

If prefix is C-b, above keys will be C-b and b.
If prefix is C-z, above keys will be C-z and z... you get the idea.

Optional settings

aggressive-resize is no longer enabled by default because it can be surprising on modern multi-client setups. To opt back into the old behavior:

set -g @sensible-set-aggressive-resize 'on'

Installation with Tmux Plugin Manager (recommended)

Add plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin 'tmux-plugins/tmux-sensible'

Hit prefix + I to fetch the plugin and source it. That's it!

Manual Installation

Clone the repo:

$ git clone https://github.com/tmux-plugins/tmux-sensible ~/clone/path

Add this line to the bottom of .tmux.conf:

run-shell ~/clone/path/sensible.tmux

Reload TMUX environment with $ tmux source-file ~/.tmux.conf, and that's it.

Other goodies

You might also find these useful:

  • copycat improve tmux search and reduce mouse usage
  • pain control useful standard bindings for controlling panes
  • resurrect persists tmux environment across system restarts

License

MIT

About

basic tmux settings everyone can agree on

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%