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/vim-keys.conf | 36 | ||||
-rw-r--r-- | examples/xterm-keys.vim | 49 |
7 files changed, 548 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/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 diff --git a/examples/xterm-keys.vim b/examples/xterm-keys.vim new file mode 100644 index 00000000..5672c26a --- /dev/null +++ b/examples/xterm-keys.vim @@ -0,0 +1,49 @@ +" tmux.vim - Set xterm input codes passed by tmux +" Author: Mark Oteiza +" License: Public domain +" Description: Simple plugin that assigns some xterm(1)-style keys to escape +" sequences passed by tmux when "xterm-keys" is set to "on". Inspired by an +" example given by Chris Johnsen at: +" https://stackoverflow.com/a/15471820 +" +" Documentation: help:xterm-modifier-keys man:tmux(1) + +if exists("g:loaded_tmux") || &cp + finish +endif +let g:loaded_tmux = 1 + +function! s:SetXtermCapabilities() + set ttymouse=sgr + + execute "set <xUp>=\e[1;*A" + execute "set <xDown>=\e[1;*B" + execute "set <xRight>=\e[1;*C" + execute "set <xLeft>=\e[1;*D" + + execute "set <xHome>=\e[1;*H" + execute "set <xEnd>=\e[1;*F" + + execute "set <Insert>=\e[2;*~" + execute "set <Delete>=\e[3;*~" + execute "set <PageUp>=\e[5;*~" + execute "set <PageDown>=\e[6;*~" + + execute "set <xF1>=\e[1;*P" + execute "set <xF2>=\e[1;*Q" + execute "set <xF3>=\e[1;*R" + execute "set <xF4>=\e[1;*S" + + execute "set <F5>=\e[15;*~" + execute "set <F6>=\e[17;*~" + execute "set <F7>=\e[18;*~" + execute "set <F8>=\e[19;*~" + execute "set <F9>=\e[20;*~" + execute "set <F10>=\e[21;*~" + execute "set <F11>=\e[23;*~" + execute "set <F12>=\e[24;*~" +endfunction + +if exists('$TMUX') + call s:SetXtermCapabilities() +endif |