SHARE
TWEET

Untitled

a guest Feb 25th, 2020 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # remap prefix from 'C-b' to 'C-a'
  2. unbind C-b
  3. set-option -g prefix C-b
  4. bind-key C-b send-prefix
  5.  
  6. # Scrollback History
  7. set-option -g history-limit 10000
  8.  
  9. # vi mode
  10. setw -g mode-keys vi
  11.  
  12. # split panes using v and s
  13. bind s split-window -h
  14. bind v split-window -v
  15. unbind '"'
  16. unbind %
  17.  
  18. # Setup 'v' to begin selection as in Vim
  19. bind-key -T copy-mode-vi v send -X begin-selection
  20. #bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
  21. bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
  22.  
  23.  
  24. # Update default binding of `Enter` to also use copy-pipe
  25. unbind -T copy-mode-vi Enter
  26. bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
  27.  
  28. # reload config file (change file location to your the tmux.conf you want to use)
  29. bind r source-file ~/.tmux.conf
  30.  
  31. # switch panes using Alt-arrow without prefix
  32. bind -n M-Left select-pane -L
  33. bind -n M-Right select-pane -R
  34. bind -n M-Up select-pane -U
  35. bind -n M-Down select-pane -D
  36.  
  37. # Enable mouse mode (tmux 2.1 and above)
  38. set -g mouse on
  39.  
  40. # don't rename windows automatically
  41. set-option -g allow-rename off
  42.  
  43.  
  44. ######################
  45. ###### SESSIONS ######
  46. ######################
  47.  
  48. # Alt-t: New session
  49. bind -n M-t command-prompt "new-session -s '%%'"
  50. # Alt-p: Choose session. Use fzf
  51. bind -n M-p new-window 'session=$(tmux list-sessions -F "#{session_name}" | fzf --query="$1" --select-1 --exit-0) && tmux switch-client -t "$session"'
  52. # Alt-n: New window
  53. bind -n M-n new-window -c "#{pane_current_path}"
  54.  
  55. # Alt-h: Previous window
  56. bind -n M-h prev
  57. bind -n M-H prev
  58.  
  59. # Alt-l: Next window
  60. bind -n M-l next
  61. bind -n M-L next
  62.  
  63. # Alt-r: Rename window
  64. bind -n M-r command-prompt -I "#W" "rename-window '%%'"
  65.  
  66. # window movement / renumbering like in screen's :number
  67. bind-key m command-prompt -p "move window to:"  "swap-window -t '%%'"
  68.  
  69.  
  70. ######################
  71. ### DESIGN CHANGES ###
  72. ######################
  73.  
  74. set -g default-terminal "screen-256color"
  75. set-option -g status-position bottom
  76. bind-key -n S-Up set-option -g status
  77. bind-key -n S-Down set-option -g status
  78. set-window-option -g window-status-current-style fg=red
  79. set-option -g status-fg white
  80. set-option -g status-bg default
  81. set -g status-left " "
  82. set -g status-justify left
  83. setw -g window-status-format         ' #(echo "#W") '
  84. setw -g window-status-current-format ' #(echo "#W") '
  85. set -g status-right "#[fg=blue]HTB #[fg=yellow]:: #[fg=green]#(ifconfig tun0 | grep 'inet ' | tr -s ' ' | cut -d\" \" -f3)"
  86.  
  87. # border colours
  88. set -g pane-border-style fg=magenta
  89. set -g pane-active-border-style "bg=default fg=magenta"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top