版本 tmux 2.1+

    1. # Base settings
    2. set -g default-terminal "screen-256color"
    3. set -g display-time 3000
    4. set -g escape-time 0
    5. set -g history-limit 65535
    6. set -g base-index 1
    7. set -g pane-base-index 1
    8. # Prefix bind
    9. set -g prefix C-a
    10. unbind C-b
    11. bind C-a send-prefix
    12. # Split window
    13. bind - splitw -v
    14. bind | splitw -h
    15. # Select window
    16. bind k select-pane -U
    17. bind j select-pane -D
    18. bind h select-pane -L
    19. bind l select-pane -R
    20. bind -r C-h select-window -t :-
    21. bind -r C-l select-window -t :+
    22. # Start mouse
    23. set-option -g mouse on
    24. # Copy --> vim mode
    25. setw -g mode-keys vi
    26. # Update config file
    27. bind R source-file ~/.tmux.conf \; display "Reloaded!"
    28. set -g status-bg colour235
    29. set -g status-fg white
    30. set-option -g status-justify centre
    31. set-option -g status-left '#[bg=black,fg=green][#[fg=cyan]#(echo $USER)@#H#[fg=red]:#[fg=blue]#S#[fg=green]]'
    32. set-option -g status-left-length 30
    33. setw -g automatic-rename on
    34. set-window-option -g window-status-format '#[dim]#I:#[default]#W#[fg=grey,dim]'
    35. set-window-option -g window-status-current-format '#[fg=cyan,bold]#I#[fg=blue]:#[fg=cyan]#W#[fg=dim]'
    36. set-window-option -g window-status-current-fg colour208
    37. set -g status-right '#[fg=green][#[fg=cyan]%H:%M %Y-%m-%d#[fg=green]]'
    38. # List of plugins
    39. set -g @plugin 'tmux-plugins/tpm'
    40. set -g @plugin 'tmux-plugins/tmux-sensible'
    41. set -g @plugin 'nhdaly/tmux-better-mouse-mode'
    42. # Plugin options
    43. set -g @scroll-speed-num-lines-per-scroll 3
    44. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
    45. run '~/.tmux/plugins/tpm/tpm'