]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - shell/tmux.conf.in
Move to shell/ in preparation for merge into new dotfiles repository
[config/dotfiles.git] / shell / tmux.conf.in
diff --git a/shell/tmux.conf.in b/shell/tmux.conf.in
new file mode 100644 (file)
index 0000000..6d582d9
--- /dev/null
@@ -0,0 +1,133 @@
+# Tmux configuration file.
+#
+# Notes:
+#
+# - To swap/renumber windows (like GNU screen's :number command) use
+#   :swap-window -t <number>.
+# - GNU screen's screen -x can be replicated with tmux new-session -t.
+
+# Copyright (C) 2011-2013  Simon Ruderich
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# GENERAL
+
+# Use vlock to lock the screen. Tmux doesn't have an internal lock program
+# like GNU screen!
+set-option -g lock-command "vlock"
+# Lock sessions individually. Otherwise lock-after-time will wait on all other
+# sessions to idle before it locks this session.
+set-option -g lock-server off
+
+# Use Zsh as shell. Tmux does not display a warning if the shell isn't
+# available!
+set-option -g default-shell "/bin/zsh"
+
+# Use a larger window history, in lines.
+set-option -g history-limit 50000
+
+# Display Tmux messages for a longer time, in milliseconds.
+set-option -g display-time 3000
+
+# Open new windows with the current working directory used when Tmux was
+# started, and not the working directory of the current pane.
+set-option -g default-path "."
+
+
+# TERMINAL
+
+# Enable 256 color mode.
+set-option -g default-terminal "screen-256color"
+
+# Disable alternative screen feature. This way e.g. Vim's window content stays
+# visible after quitting Vim. This is quite useful to copy data (needs tmux
+# 1.5 to work (almost) completely).
+set-window-option -g alternate-screen off
+
+# Set title for outer terminal.
+set-option -g set-titles on
+
+# Don't rename windows to the currently running program, my zshrc does this
+# for me (with some additional features).
+set-window-option -g automatic-rename off
+
+
+# STATUS LINE
+
+# White text.
+set-option -g status-fg white
+# Bright blue background color (colour12).
+set-option -g status-bg colour12
+
+# Nothing left of window list.
+set-option -g status-left ""
+# Current load average and hostname (#H) on the right.
+set-option -g status-right "#(uptime | sed 's/^.*load averages*: //; s/,//g') \
+                            #H \
+                            #(~/.shell/bin/temperature.pl -t TEMPERATURE)\
+                            #[] #(~/.shell/bin/battery.pl -t BATTERY)\
+                            "
+
+# Format for windows in the window list in the status line. #I window index,
+# #W window number, #F window flags.
+set-window-option -g window-status-format         "#I #W#F"
+set-window-option -g window-status-current-format "#I #W#F"
+
+# Update status line commands (#(..)) only every minute.
+set-option -g status-interval 60
+
+
+# BINDINGS
+
+# Use Vi(m) key bindings.
+set-option        -g status-keys vi
+set-window-option -g mode-keys vi
+
+# Use Ctrl-A as escape binding, like in GNU screen.
+set-option -g prefix C-a
+# Ctrl-A a sends Ctrl-A to the process, like in GNU screen.
+bind-key a send-prefix
+unbind-key C-b
+
+# GNU screen like bindings (with C-x).
+bind-key C-c new-window
+bind-key C-a last-window
+bind-key C-n next-window
+bind-key C-p previous-window
+bind-key C-[ copy-mode
+bind-key C-] paste-buffer
+
+# Arrow-key replacements for tmux's prompt.
+bind-key -t vi-edit C-n history-down
+bind-key -t vi-edit C-p history-up
+
+# Display date/time, similar to GNU screen's ^a ^t. Tmux's default ^a t just
+# displays the current time, but I often want to know the current date.
+bind-key C-t display-message
+
+# Run urlview on the current screen content. Very useful to follow links.
+# Thanks to Arch wiki (https://wiki.archlinux.org/index.php/Tmux) for the
+# basic idea how to enable this in tmux.
+bind-key C-b capture-pane \; \
+             save-buffer ~/.tmp/tmux-urlview \; \
+             delete-buffer \; \
+             new-window "urlview <~/.tmp/tmux-urlview"
+
+# Binding for fast switching to windows 10 to 29 (and more if necessary).
+# Thanks to Kays in #irssi on Freenode (2012-10-18 16:25 CEST) for reminding
+# me of this issue in Tmux. See tmux-windows.pl for details how it works.
+bind-key \; source-file "TMUX_WINDOW_PATH"
+
+# vim: ft=tmux