.tmux.conf 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. # ██████████ ████ ████ ██ ██ ██ ██
  2. # ░░░░░██░░░ ░██░██ ██░██░██ ░██░░██ ██
  3. # ░██ ░██░░██ ██ ░██░██ ░██ ░░██ ██
  4. # ░██ ░██ ░░███ ░██░██ ░██ ░░███
  5. # ░██ ░██ ░░█ ░██░██ ░██ ██░██
  6. # ░██ ░██ ░ ░██░██ ░██ ██ ░░██
  7. # ░██ ░██ ░██░░███████ ██ ░░██
  8. # ░░ ░░ ░░ ░░░░░░░ ░░ ░░
  9. #
  10. # ▓▓▓▓▓▓▓▓▓▓
  11. # ░▓ Author ▓ AK <abdullah@abdullah.today>
  12. # ░▓▓▓▓▓▓▓▓▓▓
  13. # ░░░░░░░░░░
  14. # Custom Prefix
  15. unbind C-b
  16. set-option -g prefix `
  17. bind ` send-prefix
  18. # Shell
  19. set -g default-command /bin/zsh
  20. set -g default-shell /bin/zsh
  21. # utf-8 support in status bar
  22. #set -g status-utf8 on
  23. # Reload the config
  24. bind r source-file ~/.tmux.conf \; display "~/.tmux.conf reloaded"
  25. # Synchronize panes
  26. bind e setw synchronize-panes \; display "synchronize mode"
  27. # Splits
  28. unbind %
  29. unbind '"'
  30. bind h split-window -v
  31. bind v split-window -h
  32. #bind -n M-h send-keys
  33. # enable vi-mode
  34. setw -g mode-keys vi
  35. set -g status-keys vi
  36. # copy paste
  37. unbind [
  38. bind Escape copy-mode
  39. unbind p
  40. bind p paste-buffer
  41. bind-key -T copy-mode-vi 'v' send -X begin-selection
  42. bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
  43. # command mode
  44. bind : command-prompt
  45. # Kill panes
  46. bind x kill-pane
  47. # Status on off key
  48. bind t set status
  49. # Alerts
  50. setw -g monitor-activity on
  51. set -g visual-activity on
  52. # Enable mouse mode
  53. setw -g mouse on
  54. # Default terminal mode
  55. set -g default-terminal 'screen-256color'
  56. # Status and colors
  57. set -g status-justify left
  58. set -g status-interval 2
  59. set -g status-bg colour25
  60. set -g status-fg colour222
  61. # Window status
  62. set-option -g status-position bottom
  63. setw -g window-status-format "#[bg=colour246, fg=colour14, bold] #W "
  64. setw -g window-status-current-format "#[bg=colour25, fg=colour14, bold] #W "
  65. # Right status
  66. set -g status-right-length 100
  67. set -g status-right '#(~/.local/bin/tmux-status)'
  68. set -g status-left-length 50
  69. set -g status-left ''
  70. # Visuals
  71. setw -g monitor-activity on
  72. set-option -g bell-action none
  73. set-option -g visual-activity on
  74. set-option -g visual-bell off
  75. set-option -g visual-silence off
  76. # clock
  77. set -g clock-mode-colour colour20
  78. # urlview
  79. run-shell $HOME/.local/bin/tmux.urlview
  80. # resize panes
  81. setw -g aggressive-resize on
  82. # No delay
  83. set -sg escape-time 0
  84. # History
  85. set -g history-limit 10000
  86. # Scrolling
  87. set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
  88. # Panes index
  89. set -g pane-base-index 1
  90. set -g renumber-windows on
  91. # Windows index
  92. set -g base-index 1
  93. # Layouts
  94. bind Z previous-layout
  95. bind X next-layout
  96. # Detach others
  97. bind D detach -a
  98. # Navigate and resize splits
  99. is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
  100. | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
  101. bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
  102. bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
  103. bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
  104. bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
  105. bind -n M-h if-shell "$is_vim" "send-keys M-h" "resize-pane -L 2"
  106. bind -n M-l if-shell "$is_vim" "send-keys M-l" "resize-pane -R 2"
  107. bind -n M-k if-shell "$is_vim" "send-keys M-k" "resize-pane -U 2"
  108. bind -n M-j if-shell "$is_vim" "send-keys M-j" "resize-pane -D 2"