.tmux.conf 3.8 KB

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