diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/bash_completion_tmux.sh | 105 | ||||
-rw-r--r-- | examples/h-boetes.conf | 42 | ||||
-rw-r--r-- | examples/n-marriott.conf | 110 | ||||
-rw-r--r-- | examples/screen-keys.conf | 102 | ||||
-rw-r--r-- | examples/t-williams.conf | 104 | ||||
-rw-r--r-- | examples/tmux-zoom.sh | 57 | ||||
-rw-r--r-- | examples/tmux.vim | 112 | ||||
-rw-r--r-- | examples/tmux_backup.sh | 81 | ||||
-rw-r--r-- | examples/vim-keys.conf | 36 |
9 files changed, 749 insertions, 0 deletions
diff --git a/examples/bash_completion_tmux.sh b/examples/bash_completion_tmux.sh new file mode 100644 index 00000000..74728b91 --- /dev/null +++ b/examples/bash_completion_tmux.sh @@ -0,0 +1,105 @@ +# START tmux completion +# This file is in the public domain +# See: http://www.debian-administration.org/articles/317 for how to write more. +# Usage: Put "source bash_completion_tmux.sh" into your .bashrc +_tmux() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + opts=" \ + attach-session \ + bind-key \ + break-pane \ + capture-pane \ + choose-client \ + choose-session \ + choose-window \ + clear-history \ + clock-mode \ + command-prompt \ + confirm-before \ + copy-buffer \ + copy-mode \ + delete-buffer \ + detach-client \ + display-message \ + display-panes \ + down-pane \ + find-window \ + has-session \ + if-shell \ + join-pane \ + kill-pane \ + kill-server \ + kill-session \ + kill-window \ + last-window \ + link-window \ + list-buffers \ + list-clients \ + list-commands \ + list-keys \ + list-panes \ + list-sessions \ + list-windows \ + load-buffer \ + lock-client \ + lock-server \ + lock-session \ + move-window \ + new-session \ + new-window \ + next-layout \ + next-window \ + paste-buffer \ + pipe-pane \ + previous-layout \ + previous-window \ + refresh-client \ + rename-session \ + rename-window \ + resize-pane \ + respawn-window \ + rotate-window \ + run-shell \ + save-buffer \ + select-layout \ + select-pane \ + select-prompt \ + select-window \ + send-keys \ + send-prefix \ + server-info \ + set-buffer \ + set-environment \ + set-option \ + set-window-option \ + show-buffer \ + show-environment \ + show-messages \ + show-options \ + show-window-options \ + source-file \ + split-window \ + start-server \ + suspend-client \ + swap-pane \ + swap-window \ + switch-client \ + unbind-key \ + unlink-window \ + up-pane" + + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + +} +complete -F _tmux tmux + +# END tmux completion + + + diff --git a/examples/h-boetes.conf b/examples/h-boetes.conf new file mode 100644 index 00000000..2aa86dc5 --- /dev/null +++ b/examples/h-boetes.conf @@ -0,0 +1,42 @@ +# $Id: h-boetes.conf,v 1.2 2009-10-25 21:45:26 nicm Exp $ +# +# From Han Boetes. + +set -g default-command zsh +set -g status-right "#(uptime|awk '{print $11}') #(date)" + +# Statusbar properties. +set -g display-time 3000 +set -g status-bg black +set -g status-fg cyan +set-window-option -g window-status-current-attr bright,reverse +set-window-option -g window-status-current-bg cyan +set-window-option -g window-status-current-fg black + +# Use c-t instead of c-b as the prefix +unbind C-b +set -g prefix C-t +bind C-t send-prefix +bind t send-prefix + +# Bind function keys. +bind -n F1 select-window -t 1 +bind -n F2 select-window -t 2 +bind -n F3 select-window -t 3 +bind -n F4 select-window -t 4 +bind -n F5 select-window -t 5 +bind -n F6 select-window -t 6 +bind -n F7 select-window -t 7 +bind -n F8 select-window -t 8 + +# All new windows started at startup. +new emacs +neww irssi +neww mutt +neww +neww +neww +neww +neww + +select-window -t 1 diff --git a/examples/n-marriott.conf b/examples/n-marriott.conf new file mode 100644 index 00000000..6a047ec9 --- /dev/null +++ b/examples/n-marriott.conf @@ -0,0 +1,110 @@ +# $Id: n-marriott.conf,v 1.11 2009-11-24 19:03:59 nicm Exp $ +# +# By Nicholas Marriott. Public domain. + +# Default global options. +set -g status-bg green +set -g status-right "%H:%M" # %d-%b-%y +set -g bell-action none +set -g lock-after-time 1800 + +# Default global window options. +setw -g remain-on-exit on +setw -g window-status-current-attr "underscore" +#setw -g xterm-keys on + +# Prefix key. +set -g prefix C-a +unbind C-b +bind C-a send-prefix + +# Keys to switch session. +bind Q switchc -t0 +bind W switchc -t1 +bind E switchc -t2 + +# Other key bindings. +bind F1 selectw -t:10 +bind F2 selectw -t:11 +bind F3 selectw -t:12 +bind F4 selectw -t:13 +bind F5 selectw -t:14 +bind F6 selectw -t:15 +bind F7 selectw -t:16 +bind F8 selectw -t:17 +bind F9 selectw -t:18 +bind F10 selectw -t:19 +bind F11 selectw -t:20 +bind F12 selectw -t:21 + +bind m setw monitor-activity + +bind y setw force-width 81 +bind u setw force-width 0 + +bind -n F1 run-shell 'mpc toggle >/dev/null 2>&1' +bind -n F2 run-shell 'mpc' +bind -n F3 run-shell 'mpc prev >/dev/null 2>&1' +bind -n F4 run-shell 'mpc next >/dev/null 2>&1' +bind -n F5 run-shell 'mpc volume -5 >/dev/null 2>&1' +bind -n F6 run-shell 'mpc volume +5 >/dev/null 2>&1' + +# Hide and show window name from status line +bind '-' setw window-status-format '#I'\; setw window-status-current-format '#I' +bind '+' setw window-status-format '#I:#W#F'\; setw window-status-current-format '#I:#W#F' + +# First session. +new -d -s0 -nirssi 'exec ssh -t natalya exec sh ~/bin/tmux-start' +setw -t0:0 monitor-activity on +setw -t0:0 aggressive-resize on +set -t0 status-bg green +neww -d -ntodo 'exec emacs ~/TODO' +setw -t0:1 aggressive-resize on +neww -d -ntodo2 'exec emacs ~/TODO2' +setw -t0:2 aggressive-resize on +neww -d -nncmpc 'exec ncmpc -f ~/.ncmpc.conf' +setw -t0:3 aggressive-resize on +neww -d -nmutt 'exec mutt' +setw -t0:4 aggressive-resize on +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d + +# Second session. +new -d -s1 +set -t1 status-bg cyan +linkw -dk -t0 -s0:0 +linkw -dk -t1 -s0:1 +linkw -dk -t2 -s0:2 +linkw -dk -t3 -s0:3 +linkw -dk -t4 -s0:4 +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d + +# Third session. +new -d -s2 +set -t2 status-bg yellow +linkw -dk -t0 -s0:0 +linkw -dk -t1 -s0:1 +linkw -dk -t2 -s0:2 +linkw -dk -t3 -s0:3 +linkw -dk -t4 -s0:4 +neww -d +neww -d +neww -d +neww -d +neww -d +neww -d diff --git a/examples/screen-keys.conf b/examples/screen-keys.conf new file mode 100644 index 00000000..ce149290 --- /dev/null +++ b/examples/screen-keys.conf @@ -0,0 +1,102 @@ +# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $ +# +# By Nicholas Marriott. Public domain. +# +# This configuration file binds many of the common GNU screen key bindings to +# appropriate tmux key bindings. Note that for some key bindings there is no +# tmux analogue and also that this set omits binding some commands available in +# tmux but not in screen. +# +# Note this is only a selection of key bindings and they are in addition to the +# normal tmux key bindings. This is intended as an example not as to be used +# as-is. + +# Set the prefix to ^A. +unbind C-b +set -g prefix ^A +bind a send-prefix + +# Bind appropriate commands similar to screen. +# lockscreen ^X x +unbind ^X +bind ^X lock-server +unbind x +bind x lock-server + +# screen ^C c +unbind ^C +bind ^C new-window +unbind c +bind c new-window + +# detach ^D d +unbind ^D +bind ^D detach + +# displays * +unbind * +bind * list-clients + +# next ^@ ^N sp n +unbind ^@ +bind ^@ next-window +unbind ^N +bind ^N next-window +unbind " " +bind " " next-window +unbind n +bind n next-window + +# title A +unbind A +bind A command-prompt "rename-window %%" + +# other ^A +unbind ^A +bind ^A last-window + +# prev ^H ^P p ^? +unbind ^H +bind ^H previous-window +unbind ^P +bind ^P previous-window +unbind p +bind p previous-window +unbind BSpace +bind BSpace previous-window + +# windows ^W w +unbind ^W +bind ^W list-windows +unbind w +bind w list-windows + +# quit \ +unbind '\' +bind '\' confirm-before "kill-server" + +# kill K k +unbind K +bind K confirm-before "kill-window" +unbind k +bind k confirm-before "kill-window" + +# redisplay ^L l +unbind ^L +bind ^L refresh-client +unbind l +bind l refresh-client + +# split -v | +unbind | +bind | split-window + +# :kB: focus up +unbind Tab +bind Tab select-pane -t:.+ +unbind BTab +bind BTab select-pane -t:.- + +# " windowlist -b +unbind '"' +bind '"' choose-window diff --git a/examples/t-williams.conf b/examples/t-williams.conf new file mode 100644 index 00000000..0a2cc3f5 --- /dev/null +++ b/examples/t-williams.conf @@ -0,0 +1,104 @@ +# $Id: t-williams.conf,v 1.1 2009-11-02 18:59:28 nicm Exp $ +# +# ~/.tmux.conf - tmux terminal multiplexer config +# Thayer Williams (http://cinderwick.ca) +# "Feel free to do whatever you like with it." + +# I typically start tmux from ~/.xinitrc with the following: +# +# urxvt -e bash -c "tmux attach -d -t mysession" & +# +# and recall it any time thereafter with xbindkeys (Mod4+s): +# +# "urxvt -e bash -c 'tmux attach -d -t mysession'" +# m:0x50 + c:39 + + +# set prefix key to ctrl+a until I have time to adapt +unbind C-b +set -g prefix C-a + +# send the prefix to client inside window (ala nested sessions) +bind-key a send-prefix + +# toggle last window like screen +bind-key C-a last-window + +# confirm before killing a window or the server +bind-key k confirm kill-window +bind-key K confirm kill-server + +# toggle statusbar +bind-key b set-option status + +# ctrl+left/right cycles thru windows +bind-key -n C-right next +bind-key -n C-left prev + +# open a man page in new window +bind / command-prompt "split-window 'exec man %%'" + +# quick view of processes +bind '~' split-window "exec htop" + +# scrollback buffer n lines +set -g history-limit 5000 + +# listen for activity on all windows +set -g bell-action any + +# on-screen time for display-panes in ms +set -g display-panes-time 2000 + +# start window indexing at one instead of zero +set -g base-index 1 + +# enable wm window titles +set -g set-titles on + +# wm window title string (uses statusbar variables) +set -g set-titles-string "tmux.#I.#W" + +# session initialization +new -s mysession mutt +neww -t 2 +neww -d -t 3 +neww -d -t 5 mocp +neww -d -t 6 rtorrent +selectw -t 1 + +# statusbar -------------------------------------------------------------- + +set -g display-time 2000 + +# default statusbar colors +set -g status-fg white +set -g status-bg default +set -g status-attr default + +# default window title colors +set-window-option -g window-status-fg cyan +set-window-option -g window-status-bg default +set-window-option -g window-status-attr dim + +# active window title colors +set-window-option -g window-status-current-fg white +set-window-option -g window-status-current-bg default +set-window-option -g window-status-current-attr bright + +# command/message line colors +set -g message-fg white +set -g message-bg black +set -g message-attr bright + +# center align the window list +set -g status-justify centre + +# show some useful stats but only when tmux is started +# outside of Xorg, otherwise dwm statusbar shows these already +set -g status-right "" +set -g status-left "" +if '[ -z "$DISPLAY" ]' 'set -g status-left "[#[fg=green] #H #[default]]"' +if '[ -z "$DISPLAY" ]' 'set -g status-right "[ #[fg=magenta]#(cat /proc/loadavg | cut -d \" \" -f 1,2,3)#[default] ][ #[fg=cyan,bright]%a %Y-%m-%d %H:%M #[default]]"' +if '[ -z "$DISPLAY" ]' 'set -g status-right-length 50' + diff --git a/examples/tmux-zoom.sh b/examples/tmux-zoom.sh new file mode 100644 index 00000000..3a604564 --- /dev/null +++ b/examples/tmux-zoom.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# Copyright (c) 2012 Juan Ignacio Pumarino, jipumarino@gmail.com +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Instructions +# ------------ +# +# 1. Install this script and give it execute permission somewhere in your PATH. +# For example: +# +# $ mkdir -p ~/bin +# $ wget https://raw.github.com/jipumarino/tmux-zoom/master/tmux-zoom.sh -O ~/bin/tmux-zoom.sh +# $ chmod +x ~/bin/tmux-zoom.sh +# +# 2. Add a shortcut in your ~/.tmux.conf file: +# +# bind C-k run "tmux-zoom.sh" +# +# 3. When using this shortcut, the current tmux pane will open in a new window by itself. +# Running it again in the zoomed window will return it to its original pane. You can have +# as many zoomed windows as you want. + +current=$(tmux display-message -p '#W-#I-#P') +list=$(tmux list-window) + +[[ "$current" =~ ^(.*)-([0-9]+)-([0-9]+) ]] +current_window=${BASH_REMATCH[1]} +current_pane=${BASH_REMATCH[2]}-${BASH_REMATCH[3]} +new_zoom_window=ZOOM-$current_pane + +if [[ $current_window =~ ZOOM-([0-9]+)-([0-9+]) ]]; then + old_zoom_window=ZOOM-${BASH_REMATCH[1]}-${BASH_REMATCH[2]} + tmux select-window -t ${BASH_REMATCH[1]} \; select-pane -t ${BASH_REMATCH[2]} \; swap-pane -s $old_zoom_window.1 \; kill-window -t $old_zoom_window +elif [[ $list =~ $new_zoom_window ]]; then + tmux select-window -t $new_zoom_window +else + tmux new-window -d -n $new_zoom_window \; swap-pane -s $new_zoom_window.1 \; select-window -t $new_zoom_window +fi diff --git a/examples/tmux.vim b/examples/tmux.vim new file mode 100644 index 00000000..f1a98be4 --- /dev/null +++ b/examples/tmux.vim @@ -0,0 +1,112 @@ +" Vim syntax file +" Language: tmux(1) configuration file +" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net> +" Last Change: $Date: 2010-07-27 18:29:07 $ +" License: This file is placed in the public domain. + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +setlocal iskeyword+=- +syntax case match + +syn keyword tmuxAction any current none +syn keyword tmuxBoolean off on + +syn keyword tmuxCmds + \ attach[-session] detach[-client] has[-session] kill-server + \ kill-session lsc list-clients lscm list-commands ls list-sessions + \ lockc lock-client locks lock-session new[-session] refresh[-client] + \ rename[-session] showmsgs show-messages source[-file] start[-server] + \ suspendc suspend-client switchc switch-client + \ copy-mode + \ breakp break-pane capturep capture-pane choose-client choose-session + \ choose-tree choose-window displayp display-panes findw find-window + \ joinp join-pane killp kill-pane killw kill-window lastp last-pane + \ last[-window] linkw link-window lsp list-panes lsw list-windows movep + \ move-pane movew move-window neww new-window nextl next-layout + \ next[-window] pipep pipe-pane prevl previous-layout prev[ious-window] + \ renamew rename-window resizep resize-pane respawnp respawn-pane + \ respawnw respawn-window rotatew rotate-window selectl select-layout + \ selectp select-pane selectw select-window splitw split-window swapp + \ swap-pane swapw swap-window unlinkw unlink-window + \ bind[-key] lsk list-keys send[-keys] send-prefix unbind[-key] + \ set[-option] setw set-window-option show[-options] showw + \ show-window-options + \ setenv set-environment showenv show-environment + \ command-prompt confirm[-before] display[-message] + \ choose-buffer clearhist clear-history deleteb delete-buffer lsb + \ list-buffers loadb load-buffer pasteb paste-buffer saveb save-buffer + \ setb set-buffer showb show-buffer + \ clock-mode if[-shell] lock[-server] run[-shell] server-info info + \ choose-list + +syn keyword tmuxOptsSet + \ buffer-limit escape-time exit-unattached exit-unattached quiet + \ set-clipboard + \ base-index bell-action bell-on-alert default-command default-path + \ default-shell default-terminal destroy-unattached detach-on-destroy + \ display-panes-active-colour display-panes-colour display-panes-time + \ display-time history-limit + \ lock-after-time lock-command lock-server + \ message-command-attr message-attr message-command-bg message-bg + \ message-command-fg message-fg message-limit + \ mouse-resize-pane mouse-select-pane mouse-select-window mouse-utf8 + \ pane-active-border-bg pane-border-bg pane-active-border-fg + \ pane-border-fg prefix prefix2 + \ renumber-windows repeat-time set-remain-on-exit set-titles + \ set-titles-string status status-attr status-bg status-fg + \ status-interval status-justify status-keys status-left + \ status-left-attr status-left-bg status-left-fg status-left-length + \ status-position status-right status-right-attr status-right-bg + \ status-right-fg status-right-length status-utf8 terminal-overrides + \ update-environment visual-activity visual-bell visual-content + \ visual-silence word-separators + +syn keyword tmuxOptsSetw + \ aggressive-resize alternate-screen automatic-rename + \ c0-change-interval c0-change-trigger clock-mode-colour + \ clock-mode-style force-height force-width layout-history-limit + \ main-pane-height main-pane-width mode-attr mode-bg mode-fg move-keys + \ mode-mouse monitor-activity monitor-content monitor-silence + \ other-pane-height other-pane-width pane-base-index remain-on-exit + \ synchronize-panes utf8 window-status-bell-attr window-status-bell-bg + \ window-status-bell-fg window-status-content-attr + \ window-status-content-bg window-status-content-fg + \ window-status-activity-attr window-status-activity-bg + \ window-status-activity-fg window-status-attr + \ window-status-current-attr window-status-attr window-status-current-bg + \ window-status-bg window-status-current-fg window-status-fg + \ window-status-current-format window-status-format + \ window-status-separator xterm-keys wrap-search + +syn keyword tmuxTodo FIXME NOTE TODO XXX contained + +syn match tmuxKey /\(C-\|M-\|\^\)\+\S\+/ display +syn match tmuxNumber /\d\+/ display +syn match tmuxOptions /\s-\a\+/ display +syn match tmuxVariable /\w\+=/ display +syn match tmuxVariableExpansion /\${\=\w\+}\=/ display + +syn region tmuxComment start=/#/ end=/$/ contains=tmuxTodo display oneline +syn region tmuxString start=/"/ end=/"/ display oneline +syn region tmuxString start=/'/ end=/'/ display oneline + +hi def link tmuxAction Boolean +hi def link tmuxBoolean Boolean +hi def link tmuxCmds Keyword +hi def link tmuxComment Comment +hi def link tmuxKey Special +hi def link tmuxNumber Number +hi def link tmuxOptions Identifier +hi def link tmuxOptsSet Function +hi def link tmuxOptsSetw Function +hi def link tmuxString String +hi def link tmuxTodo Todo +hi def link tmuxVariable Constant +hi def link tmuxVariableExpansion Constant + +let b:current_syntax = "tmux" diff --git a/examples/tmux_backup.sh b/examples/tmux_backup.sh new file mode 100644 index 00000000..bc0bf370 --- /dev/null +++ b/examples/tmux_backup.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# +# By Victor Orlikowski. Public domain. +# +# This script maintains snapshots of each pane's +# history buffer, for each tmux session you are running. +# +# It is intended to be run by cron, on whatever interval works +# for you. + +# Maximum number of snapshots to keep. +max_backups=12 +# Names of sessions you may wish to exclude from snapshotting, +# space separated. +ignore_sessions="" +# The directory into which you want your snapshots placed. +# The default is probably "good enough." +backup_dir=~/.tmux_backup/snapshot + +######################################################################## + +# Rotate previous backups. +i=${max_backups} +while [[ ${i} != 0 ]] ; do +if [ -d ${backup_dir}.${i} ] ; then + if [[ ${i} = ${max_backups} ]] ; then + rm -r ${backup_dir}.${i} + else + mv ${backup_dir}.${i} ${backup_dir}.$((${i}+1)) + fi +fi +i=$((${i}-1)) +done + +if [ -d ${backup_dir} ] ; then + mv ${backup_dir} ${backup_dir}.1 +fi + +## Dump hardcopy from all windows in all available tmux sessions. +unset TMUX +for session in $(tmux list-sessions | cut -d' ' -f1 | sed -e 's/:$//') ; do + for ignore_session in ${ignore_sessions} ; do + if [ ${session} = ${ignore_session} ] ; then + continue 2 + fi + done + + # Session name can contain the colon character (":"). + # This can screw up addressing of windows within tmux, since + # target windows are specified as target-session:target-window. + # + # We use uuidgen to create a "safe" temporary session name, + # which we then use to create a "detached" session that "links" + # to the "real" session that we want to back up. + tmpsession=$(uuidgen) + tmux new-session -d -s "$tmpsession" -t "$session" + HISTSIZE=$(tmux show-options -g -t "$tmpsession" | grep "history-limit" | awk '{print $2}') + for win in $(tmux list-windows -t "$tmpsession" | grep -v "^\s" | cut -d' ' -f1 | sed -e 's/:$//'); do + session_dir=$(echo "$session" | sed -e 's/ /_/g' | sed -e 's%/%|%g') + win_spec="$tmpsession":"$win" + + if [ ! -d ${backup_dir}/${session_dir}/${win} ] ; then + mkdir -p ${backup_dir}/${session_dir}/${win} + fi + + for pane in $(tmux list-panes -t "$win_spec" | cut -d' ' -f1 | sed -e 's/:$//'); do + pane_path=${backup_dir}/${session_dir}/${win}/${pane} + pane_spec="$win_spec"."$pane" + + tmux capture-pane -t "$pane_spec" -S -${HISTSIZE} + tmux save-buffer ${pane_path} + + if [ ! -s ${pane_path} ] ; then + sleep 1 + rm ${pane_path} + fi + done + done + tmux kill-session -t "$tmpsession" + +done diff --git a/examples/vim-keys.conf b/examples/vim-keys.conf new file mode 100644 index 00000000..d587d0bf --- /dev/null +++ b/examples/vim-keys.conf @@ -0,0 +1,36 @@ +# $Id: vim-keys.conf,v 1.2 2010-09-18 09:36:15 nicm Exp $ +# +# vim-keys.conf, v1.2 2010/09/12 +# +# By Daniel Thau. Public domain. +# +# This configuration file binds many vi- and vim-like bindings to the +# appropriate tmux key bindings. Note that for many key bindings there is no +# tmux analogue. This is intended for tmux 1.3, which handles pane selection +# differently from the previous versions + +# split windows like vim +# vim's definition of a horizontal/vertical split is reversed from tmux's +bind s split-window -v +bind v split-window -h + +# move around panes with hjkl, as one would in vim after pressing ctrl-w +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# resize panes like vim +# feel free to change the "1" to however many lines you want to resize by, only +# one at a time can be slow +bind < resize-pane -L 1 +bind > resize-pane -R 1 +bind - resize-pane -D 1 +bind + resize-pane -U 1 + +# bind : to command-prompt like vim +# this is the default in tmux already +bind : command-prompt + +# vi-style controls for copy mode +setw -g mode-keys vi |