# Global settings # Set prefix key to Ctrl-a unbind-key C-b set-option -g prefix C-q # send the prefix to client inside window (tmux inside tmux) bind-key C-q send-prefix # toggle last window like screen bind-key C-a last-window # toggle send-to-all-panes #bind-key C-s synchronize-panes on #bind-key M-s synchronize-panes off # open a man page in new window bind-key / command-prompt "split-window 'exec man %%'" # quick view of processes bind-key "~" split-window "exec top" # scrollback buffer n lines set -g history-limit 20000 # listen for activity on all windows set -g bell-action any #set -g bell-action none # start window indexing at one set -g base-index 1 # instructs tmux to expect UTF-8 sequences setw -g utf8 on # tell tmux to use 256 colour terminal set -g default-terminal screen-256color #set -g default-terminal xterm-256color # xterm-style function key sequences setw -g xterm-keys on # control automatic window renaming setw -g automatic-rename on # enable wm window titles set -g set-titles on #set -g mouse-select-pane on # set escape time to immediate set -sg escape-time 0 # Key bindings bind-key -n F1 select-window -t:1 bind-key -n F2 select-window -t:2 bind-key -n F3 select-window -t:3 bind-key -n F4 select-window -t:4 bind-key -n F5 select-window -t:- bind-key -n F6 select-window -t:+ bind-key -n F7 select-pane -t:.- bind-key -n F8 select-pane -t:.+ bind-key -n F12 new-window # reload settings bind-key R source-file ~/.tmux.conf # detach client bind-key d detach bind-key C-d detach # choose a client to detach bind-key D choose-client # choose window/session bind-key "'" choose-window bind-key '"' choose-session # display visible indicator of each pane bind-key p display-panes # navigate panes using jk, and ctrl+jk (no prefix) #bind-key -r j select-pane -t :.- #bind-key -r k select-pane -t :.+ #bind-key -rn C-j select-pane -t :.- #bind-key -rn C-k select-pane -t :.+ # navigate windows using hl, and ctrl-hl (no prefix) bind-key -r h select-window -t :- bind-key -r l select-window -t :+ bind-key -n C-right select-window -t :- bind-key -n C-left select-window -t :+ # swap panes bind-key -r J swap-pane -D bind-key -r K swap-pane -U # Ctrl-Left/Right cycles thru windows (no prefix) #bind-key -n "C-Left" select-window -t :- #bind-key -n "C-Right" select-window -t :+ # Ctrl-Up/Down cyles thru panes (no prefix) #bind-key -n "C-Up" select-pane -t :.- #bind-key -n "C-Down" select-pane -t :.+ # Cycle to next pane bind-key -r Tab select-pane -t :.+ # kill current pane/window #bind-key q confirm-before kill-pane #bind-key Q confirm-before kill-window #bind-key C-q confirm-before kill-pane bind-key x kill-pane bind-key X kill-window # window layouts (emacs-like) bind-key 1 break-pane bind-key 2 select-layout even-vertical bind-key 3 select-layout even-horizontal bind-key o select-pane -U # specific window layouts #bind -r y next-layout #bind o select-layout "active-only" #bind O select-layout "main-vertical" # vi-style controls for copy mode setw -g mode-keys vi # quit bind-key \ confirm-before kill-server # displays bind-key * list-clients # redisplay (default key in tmux is 'r') #bind-key C-l refresh-client #bind-key l refresh-client bind-key r refresh-client # Split windows like vim # vim's definition of a horizontal/vertical split is reversed from tmux's bind-key s split-window -v bind-key v split-window -h # alternatively, use better mnemonics for horizontal/vertical splits bind-key - split-window -v bind-key | split-window -h # resize panes like vim bind-key -r < resize-pane -L 3 bind-key -r > resize-pane -R 3 bind-key -r + resize-pane -U 1 bind-key -r = resize-pane -D 1 # Statusbar settings # toggle statusbar bind-key s set status # use vi-style key bindings in the status line set -g status-keys vi # amount of time for which status line messages and other indicators # are displayed. time is in milliseconds. set -g display-time 2000 # default statusbar colors set -g status-fg cyan set -g status-bg black set -g status-attr default # default window title colors setw -g window-status-fg green setw -g window-status-bg black setw -g window-status-attr dim # active window title colors setw -g window-status-current-fg cyan setw -g window-status-current-bg black setw -g window-status-current-attr bright setw -g window-status-current-attr underscore # command/message line colors set -g message-fg white set -g message-bg black set -g message-attr bright setw -g monitor-activity on setw -g visual-activity on # Session initialization # clock set-window-option -g clock-mode-colour cyan set-window-option -g clock-mode-style 24 #bind-key R respawn-window # create a session with a throw-away window # for future windows, revert r-o-e to global value set -u set-remain-on-exit # from http://zanshin.net/2013/09/05/my-tmux-configuration/ # ---------------------- # set some pretty colors # ---------------------- # set pane colors - hilight the active pane set-option -g pane-border-fg colour235 #base02 set-option -g pane-active-border-fg colour240 #base01 set-option -g status on # turn the status bar on set -g status-utf8 on # set utf-8 for the status bar set -g status-interval 1 # set update frequencey (default 15 seconds) set -g status-justify centre # center window list for clarity # set-option -g status-position top # position the status bar at top of screen # visual notification of activity in other windows setw -g monitor-activity on set -g visual-activity on # set color for status bar set-option -g status-bg colour235 #base02 set-option -g status-fg yellow #yellow set-option -g status-attr dim # set window list colors - red for active and cyan for inactive set-window-option -g window-status-fg brightblue #base0 set-window-option -g window-status-bg colour236 set-window-option -g window-status-attr dim set-window-option -g window-status-current-fg brightred #orange set-window-option -g window-status-current-bg colour236 set-window-option -g window-status-current-attr bright # show host name and IP address on left side of status bar set -g status-left-length 70 # set -g status-left "#[fg=green]: #h : #[fg=brightblue]#(curl icanhazip.com) #[fg=yellow]#(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}') #(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}') #[fg=red]#(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}') " set -g status-left "#[fg=green]: #h : #[fg=yellow]#(ifconfig vmx0 | grep 'inet ' | awk '{print \"vmx0 \" $2}')" # show session name, window & pane number, date and time on right side of # status bar set -g status-right-length 60 set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::" # explicitly disable mouse control setw -g mode-mouse off set -g mouse-select-pane off set -g mouse-resize-pane off set -g mouse-select-window off set-option -g lock-after-time 900 run-shell /root/tmux-logging/logging.tmux run-shell /root/tmux-resurrect/resurrect.tmux #set-option -ga terminal-overrides ',*:enacs@:smacs@:rmacs@:acsc@' new -session -sroot # create the windows we really want neww neww neww neww neww