Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. set -g prefix F12
  2. unbind-key -n C-a
  3.  
  4. # i3 like
  5. setw -g aggressive-resize on
  6.  
  7. # i3-like focus
  8. bind-key -T root M-h display-panes \; select-pane -R
  9. bind-key -T root M-j display-panes \; select-pane -D
  10. bind-key -T root M-k display-panes \; select-pane -U
  11. bind-key -T root M-l display-panes \; select-pane -L
  12.  
  13. # i3-like panes movement
  14. bind-key -T root M-H display-panes \; swap-pane -d -s :. -t ":.{left-of}"
  15. bind-key -T root M-J display-panes \; swap-pane -d -s :. -t ":.{down-of}"
  16. bind-key -T root M-K display-panes \; swap-pane -d -s :. -t ":.{up-of}"
  17. bind-key -T root M-L display-panes \; swap-pane -d -s :. -t ":.{right-of}"
  18.  
  19. # i3-like pan creation
  20. bind-key -T root M-t new-window -c "#{pane_current_path}" \; rename-window -
  21. bind-key -T root M-i display-panes \; split-window -h -c "#{pane_current_path}"
  22. bind-key -T root M-u display-panes \; split-window -v -c "#{pane_current_path}"
  23.  
  24. # i3-like zoom (in and out)
  25. bind-key -T root M-f resize-pane -Z
  26.  
  27. bind-key -T root M-x kill-pane
  28. bind-key -T root M-X kill-window
  29.  
  30. # i3-like switch
  31. set -g base-index 1
  32. setw -g pane-base-index 1
  33.  
  34. bind-key -T root M-0 select-window -t :=0
  35. bind-key -T root M-1 select-window -t :=1
  36. bind-key -T root M-2 select-window -t :=2
  37. bind-key -T root M-3 select-window -t :=3
  38. bind-key -T root M-4 select-window -t :=4
  39. bind-key -T root M-5 select-window -t :=5
  40. bind-key -T root M-5 select-window -t :=6
  41. bind-key -T root M-7 select-window -t :=7
  42. bind-key -T root M-8 select-window -t :=8
  43. bind-key -T root M-9 select-window -t :=9
  44.  
  45. # i3-like move
  46. bind-key -T root M-! join-pane -t :=1
  47. bind-key -T root M-@ join-pane -t :=2
  48. bind-key -T root M-# join-pane -t :=3
  49. bind-key -T root M-$ join-pane -t :=4
  50. bind-key -T root M-% join-pane -t :=5
  51. bind-key -T root M-^ join-pane -t :=6
  52. bind-key -T root M-& join-pane -t :=7
  53. bind-key -T root M-* join-pane -t :=8
  54. bind-key -T root M-( join-pane -t :=9
  55. bind-key -T root M-) join-pane -t :=0
  56.  
  57. bind-key -T root M-U previous-window
  58. bind-key -T root M-I next-window
  59.  
  60. # enable mouse
  61. set -g mouse on
  62.  
  63. # standard begin-selection
  64. bind-key -T copy-mode MouseDrag1Pane select-pane \; send-keys -X begin-selection
  65. bind-key -T copy-mode-vi MouseDrag1Pane select-pane \; send-keys -X begin-selection
  66.  
  67. # do nothing on release
  68. bind-key -T copy-mode MouseDragEnd1Pane run-shell "true"
  69. bind-key -T copy-mode-vi MouseDragEnd1Pane run-shell "true"
  70.  
  71. # on click cancel selection
  72. bind-key -T copy-mode MouseDown1Pane select-pane \; send-keys -X cancel
  73. bind-key -T copy-mode-vi MouseDown1Pane select-pane \; send-keys -X cancel
  74.  
  75. # on alt+c copy
  76. bind-key -T copy-mode-vi M-c send-keys -X copy-selection-and-cancel \; run-shell "tmux show-buffer | xclip -i -selection clipboard 2>/dev/null 1>/dev/null"
  77. bind-key -T copy-mode M-c send-keys -X copy-selection-and-cancel \; run-shell "tmux show-buffer | xclip -i -selection clipboard 2>/dev/null 1>/dev/null"
  78. bind-key -T copy-mode-vi Enter send-keys -X copy-selection-and-cancel \; run-shell "tmux show-buffer | xclip -i -selection clipboard 2>/dev/null 1>/dev/null"
  79. bind-key -T copy-mode Enter send-keys -X copy-selection-and-cancel \; run-shell "tmux show-buffer | xclip -i -selection clipboard 2>/dev/null 1>/dev/null"
  80. bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel \; run-shell "tmux show-buffer | xclip -i -selection clipboard 2>/dev/null 1>/dev/null"
  81. bind-key -T copy-mode y send-keys -X copy-selection-and-cancel \; run-shell "tmux show-buffer | xclip -i -selection clipboard 2>/dev/null 1>/dev/null"
  82.  
  83. # on alt+c enter copy
  84. bind-key -T root M-c copy-mode
  85.  
  86. # on alt+v paste
  87. bind-key -T root M-v run-shell "xclip -o -selection clipboard | tmux load-buffer /dev/stdin" \; paste-buffer
  88.  
  89. # vi-like copy
  90. bind-key -T root M-p run-shell "xclip -o -selection clipboard | tmux load-buffer /dev/stdin" \; paste-buffer
  91. bind-key -T copy-mode v send-keys -X begin-selection
  92. bind-key -T copy-mode-vi v send-keys -X begin-selection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement