#-------- Common Settings {{{ #------------------------------------------------------ # how to use tmux demo video: http://www.youtube.com/watch?v=ZNM1KfqpyGo # https://gist.github.com/1147532 # http://crunchbanglinux.org/forums/post/236199/ # https://gist.github.com/adinapoli/4723872 # change prefix key to Ctrl-a; like GNU Screen #unbind-key C-b #set-option -g prefix C-a # goto last used window bind-key C-a last-window # Nested Tmux Session # send to tmux session within another tmux session; like screen bind-key a send-prefix # fix delay time between tmux & vim set-option -sg escape-time 0 # default shell set-option -g default-command /bin/zsh set-option -g default-shell /bin/zsh # reload config bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded" # edit config bind-key e new-window -n 'conf' '${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"' bind-key '/' new-window 'man tmux' # clear screen and scrollback history bind-key -n C-l send-keys C-l \; run 'tmux clear-history' # set display timelimit set-option -g display-panes-time 2000 set-option -g display-time 1000 # history size set-option -g history-limit 10000 # enable shell hotkeys C-left/C-right # http://sigizmund.com/tmux-and-c-leftc-right/ set-window-option -g xterm-keys on # enable 256 color terminal # http://blog.sanctum.geek.nz/256-colour-terminals/ set-option -g default-terminal "screen-256color" # --- }}} #-------- Keybinding (Vim Style) {{{ #------------------------------------------------------ # vim keys in command prompt set-option -g status-keys vi # unicode set-window-option -g utf8 on # select panes bind-key k select-pane -U bind-key h select-pane -L bind-key j select-pane -D bind-key l select-pane -R # cycle windows/panes (no prefix) bind-key -n M-k select-pane -t :.- # prev pane bind-key -n M-j select-pane -t :.+ # next pane bind-key -n M-h select-window -t :- # previous window bind-key -n M-l select-window -t :+ # next window # resize panes bind-key -r J resize-pane -D 1 bind-key -r K resize-pane -U 1 bind-key -r H resize-pane -L 1 bind-key -r L resize-pane -R 1 # better pane split bindings with current path (tmux 1.9+) bind-key \ split-window -h -c "#{pane_current_path}" # vertical split bind-key - split-window -v -c "#{pane_current_path}" # horizontal split # new window/pane with the current path (tmux 1.9+) bind-key c new-window -c "#{pane_current_path}" # kill window/pane without prompt # http://unix.stackexchange.com/a/30283 bind-key & kill-window bind-key x kill-pane # sync panes; send what you are typing to other panes. bind-key C-s set-window-option synchronize-panes # --- }}} # music --- {{{ bind-key C-m new-window -n music -c $HOME \; \ send-keys 'clear && figlet -w 40 Radio' 'Enter' \; \ split-window -v -p 70 -t 1 \; \ send-keys 'ncmpcpp -s visualizer' 'Enter' \; \ split-window -v -p 50 -t 2 \; \ send-keys 'ncmpcpp -s playlist' 'Enter' \; \ split-window -h -p 60 -t 1 \; \ send-keys 'clear && figlet -w 40 Search Music' 'Enter' \; \ select-pane -t 1 # --- }}}