Go to file
Venkatesh.T 2f3ee2a692 Use tmux's default-shell opt to get preffered SHELL for default-command in OSX
tmux-sensible modified `default-command` for OSX to use
`reattach-to-user-namespace` when creating shell with user
preffered shell type from `SHELL` environment variable for circumventing
OSX's process namespace segregation.
Prior to tmux 3.5 this `SHELL` environment variable was not modified by Tmux
when running a shell command with tmux's default `sh` shell, so this
worked fine.
Now from tmux 3.5 `SHELL` environment variable is set to `sh`, this
causes tmux to load `sh` shell when executing default-command instead of
user preffered shell when using tmux-sensible plugin.
2024-11-17 14:08:54 +05:30
.gitattributes Add better cygwin support 2015-10-08 14:28:56 +02:00
CHANGELOG.md Remove detach-on-destroy 2015-08-10 20:29:25 +02:00
LICENSE.md First commit 2014-07-30 16:33:51 +02:00
README.md Show initial values of modified options 2022-08-14 16:34:49 +01:00
sensible.tmux Use tmux's default-shell opt to get preffered SHELL for default-command in OSX 2024-11-17 14:08:54 +05:30

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.
  • no overriding of user defined settings.
    Your existing .tmux.conf settings are respected and they won't be changed. That way you can use tmux-sensible if you have a few specific options.

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 (http://superuser.com/a/252717/65504)
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

# (OS X) Fix pbcopy/pbpaste for old tmux versions (pre 2.6)
set -g default-command "reattach-to-user-namespace -l $SHELL"

# Upgrade $TERM
set -g default-terminal "screen-256color"

# Emacs key bindings in tmux command prompt (prefix + :) are better than
# vi keys, even for vim users
set -g status-keys emacs

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

# Super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize 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 .tmux.conf as suggested in `man tmux`
bind R source-file '~/.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.

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