Advertisement
doanhtu

.tmux.conf

May 24th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.44 KB | None | 0 0
  1. # https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
  2. set-option -g status-bg colour235 #base02
  3. set-option -g status-fg colour136 #yellow
  4. set-option -g status-attr default
  5.  
  6. # default window title colors
  7. set-window-option -g window-status-fg colour244 #base0
  8. set-window-option -g window-status-bg default
  9. #set-window-option -g window-status-attr dim
  10.  
  11. # active window title colors
  12. set-window-option -g window-status-current-fg colour166 #orange
  13. set-window-option -g window-status-current-bg default
  14. #set-window-option -g window-status-current-attr bright
  15.  
  16. # pane border
  17. set-option -g pane-border-fg colour235 #base02
  18. set-option -g pane-active-border-fg colour240 #base01
  19.  
  20. # message text
  21. set-option -g message-bg colour235 #base02
  22. set-option -g message-fg colour166 #orange
  23.  
  24. # pane number display
  25. set-option -g display-panes-active-colour colour33 #blue
  26. set-option -g display-panes-colour colour166 #orange
  27. # clock
  28. set-window-option -g clock-mode-colour green #green
  29.  
  30.  
  31. set -g status-interval 1
  32. set -g status-justify centre # center align window list
  33. set -g status-left-length 20
  34. set -g status-right-length 140
  35. set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]'
  36. set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) #[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d'
  37.  
  38. # remap prefix from 'C-b' to 'C-a'
  39. unbind C-b
  40. set-option -g prefix C-a
  41. bind-key C-a send-prefix
  42.  
  43. # split panes using | and -
  44. bind | split-window -h
  45. bind - split-window -v
  46. unbind '"'
  47. unbind %
  48.  
  49. # Enable mouse mode (tmux 2.1 and above)
  50. set -g mouse off
  51.  
  52. # Start numbering at 1
  53. set -g base-index 1
  54.  
  55. # Allows for faster key repetition
  56. set -s escape-time 0
  57.  
  58. # Rather than constraining window size to the maximum size of any client
  59. # connected to the *session*, constrain window size to the maximum size of any
  60. # client connected to *that window*. Much more reasonable.
  61. setw -g aggressive-resize on
  62.  
  63. # Allows us to use C-a a <command> to send commands to a TMUX session inside
  64. # another TMUX session
  65. bind-key a send-prefix
  66.  
  67. # Activity monitoring
  68. setw -g monitor-activity on
  69. set -g visual-activity on
  70.  
  71. # Vi copypaste mode
  72. set-window-option -g mode-keys vi
  73. bind-key -t vi-copy 'v' begin-selection
  74. bind-key -t vi-copy 'y' copy-selection
  75.  
  76. # hjkl pane traversal
  77. bind h select-pane -L
  78. bind j select-pane -D
  79. bind k select-pane -U
  80. bind l select-pane -R
  81.  
  82. # set to main-horizontal, 60% height for main pane
  83. bind m set-window-option main-pane-height 60\; select-layout main-horizontal
  84.  
  85. bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
  86.  
  87. # reload config
  88. bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
  89.  
  90. # auto window rename
  91. set-window-option -g automatic-rename
  92.  
  93. # color
  94. set -g default-terminal "screen-256color"
  95.  
  96. # https://github.com/edkolev/dots/blob/master/tmux.conf
  97. # Updates for tmux 1.9's current pane splitting paths.
  98.  
  99. # from powerline
  100. run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
  101. run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
  102.  
  103. # status bar
  104. if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 2\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set-option -g status-utf8 on'
  105.  
  106. # rm mouse mode fail
  107. if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\) -o #{$TMUX_VERSION_MAJOR} -gt 2' 'set -g mouse off'
  108. if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 1\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set -g mode-mouse off'
  109.  
  110. # fix pane_current_path on new window and splits
  111. if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind c; bind c new-window -c "#{pane_current_path}"'
  112. if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'"
  113. if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind v; bind v split-window -h -c "#{pane_current_path}"'
  114. if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind %; bind % split-window -h -c "#{pane_current_path}"'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement