Advertisement
Plaidstallion

tmux.conf

Mar 24th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. #.tmux.conf
  2.  
  3. #set-option -g default-shell "/usr/bin/bash"
  4. set -g default-terminal "screen-256color"
  5.  
  6.  
  7.  
  8. #open the tmux config in tmux pane using <prefix> followed by shift + E, edit your configuration, and save when you done. To reload the tmux configuration use <prefix> followed by r.
  9. #** <prefix> is C-z for hashrocket’s dotfile project (dotmatrix), if you are using tmux default configuration it would be C-b
  10. bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
  11. bind-key E split-window -h "nano ~/.tmux.conf"
  12.  
  13. # remap prefix from 'C-b' to 'C-z'
  14. unbind C-b
  15. set-option -g prefix C-z
  16. bind-key C-z send-prefix
  17.  
  18. # split panes using | and -
  19. bind | split-window -h
  20. bind - split-window -v
  21. unbind '"'
  22. unbind %
  23.  
  24. # switch panes using Alt-arrow without prefix
  25. bind -n M-w select-pane -L
  26. bind -n M-d select-pane -R
  27. bind -n M-w select-pane -U
  28. bind -n M-s select-pane -D
  29.  
  30.  
  31. ### Mouse On/Off ### {{{
  32. ## Mouse On by default
  33. set -g mouse on
  34.  
  35.  
  36. ##Toggle mouse on with <prefix>m
  37. bind m \
  38. set -g mouse off\;\
  39. display 'Mouse: #{?mouse,on,off}'
  40.  
  41. ### End Mouse On/Off ### }}}
  42.  
  43. # Scroll History
  44. set -g history-limit 50000
  45.  
  46. # show messages for 4 seconds instead
  47. set -g display-time 4000
  48.  
  49. # set first window to index 1 (not 0) to map more to the keyboard layout
  50. set-option -g renumber-windows on
  51. set -g base-index 1
  52. setw -g pane-base-index 1
  53.  
  54. # Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
  55. set -s escape-time 50
  56.  
  57. ## Clipboard integration
  58. # ctrl+c to send to clipboard
  59. bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
  60. # ctrl+v to paste from clipboard
  61. bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
  62.  
  63. # Selection with mouse should copy to clipboard right away, in addition to the default action.
  64. unbind -n -Tcopy-mode-vi MouseDragEnd1Pane
  65. bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel clipboard > /dev/null"
  66.  
  67. # Middle click to paste from the clipboard
  68. unbind-key MouseDown2Pane
  69. bind-key -n MouseDown2Pane run " \
  70. X=$(xclip -o -sel clipboard); \
  71. tmux set-buffer \"$X\"; \
  72. tmux paste-buffer -p; \
  73. tmux display-message 'pasted!' \
  74. "
  75.  
  76. # Drag to re-order windows
  77. bind-key -n MouseDrag1Status swap-window -t=
  78.  
  79. # Double click on the window list to open a new window
  80. bind-key -n DoubleClick1Status new-window
  81.  
  82. # Shift arrow to switch windows
  83. bind -n S-Left previous-window
  84. bind -n S-Right next-window
  85.  
  86. # THEME
  87. set -g status-bg black
  88. set -g status-fg white
  89. set -g status-interval 60
  90. set -g status-left-length 30
  91. set -g status-left '#[fg=green](#S) #(whoami)'
  92. set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
  93.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement