You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
4.2 KiB

  1. # set -g default-terminal "screen-256color"
  2. set-option -sa terminal-overrides ",xterm*:Tc"
  3. # easy reload config
  4. bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
  5. set-option -g status-position top
  6. # set window split
  7. bind v split-window -h -c "#{pane_current_path}"
  8. bind b split-window -v -c "#{pane_current_path}"
  9. # C-b is not acceptable -- Vim uses it
  10. set-option -g prefix C-a
  11. bind-key C-a last-window
  12. # Start numbering at 1
  13. set -g base-index 1
  14. # Allows for faster key repetition
  15. set -s escape-time 50
  16. # Rather than constraining window size to the maximum size of any client
  17. # connected to the *session*, constrain window size to the maximum size of any
  18. # client connected to *that window*. Much more reasonable.
  19. setw -g aggressive-resize on
  20. is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'"
  21. bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' { if -F '#{pane_at_left}' '' 'select-pane -L' }
  22. bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' }
  23. bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' { if -F '#{pane_at_top}' '' 'select-pane -U' }
  24. bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' { if -F '#{pane_at_right}' '' 'select-pane -R' }
  25. bind-key -T copy-mode-vi 'C-h' if -F '#{pane_at_left}' '' 'select-pane -L'
  26. bind-key -T copy-mode-vi 'C-j' if -F '#{pane_at_bottom}' '' 'select-pane -D'
  27. bind-key -T copy-mode-vi 'C-k' if -F '#{pane_at_top}' '' 'select-pane -U'
  28. bind-key -T copy-mode-vi 'C-l' if -F '#{pane_at_right}' '' 'select-pane -R'
  29. bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
  30. bind -r j resize-pane -D 5
  31. bind -r k resize-pane -U 5
  32. bind -r l resize-pane -R 5
  33. bind -r h resize-pane -L 5
  34. set-window-option -g mode-keys vi
  35. bind-key -T copy-mode-vi 'v' send -X begin-selection
  36. bind-key -T copy-mode-vi 'y' send -X copy-selection
  37. bind 'V' copy-mode
  38. # Enable clipboard integration
  39. set-option -g set-clipboard on
  40. # Use xclip for copying text in copy mode
  41. bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -in"
  42. bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -in"
  43. # Shortcut for manual copying outside of copy mode
  44. bind-key C-c run-shell "tmux save-buffer - | xclip -selection clipboard -in"
  45. # Enable mouse control (clickable windows, panes, resizable panes)
  46. set -g mouse on
  47. unbind -T copy-mode-vi MouseDragEnd1Pane
  48. bind S command-prompt -p "New Session:" "new-session -A -s '%%'"
  49. bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
  50. # Flow colorscheme | Tmux
  51. # https://github.com/0xstepit/flow.nvim
  52. ## Statusbar style
  53. # set -g status-position top
  54. # set -g status-right-length "100"
  55. # set -g status-left-length "100"
  56. # set -g status-style bg=#141A1F,fg=#3D4F5C
  57. # set -g window-status-style fg=#3D4F5C,bg=#141A1F
  58. # setw -g window-status-separator " "
  59. # set -g window-status-current-style fg=colour198
  60. # set -g window-status-format "(#I) #W"
  61. # set -g window-status-current-format "(#I) #W"
  62. # set -g status-left "#[fg=#0D0D0D,bg=#75BDF0] #S #[bg=#3D4F5C,fg=#75BDF0] #h #[bg=#141A1F] "
  63. # set -g status-right "#[bg=#3D4F5C,fg=#75BDF0] %H:%M #[fg=#0D0D0D,bg=#75BDF0] %A %d. %b %Y "
  64. #
  65. # set -g message-command-style fg=#FF007C
  66. # set -g message-style "fg=#FF007C, bg=#141A1F" # color used in the message popup.
  67. #
  68. # set -g mode-style "fg=#FF007C"
  69. # ## Borders
  70. # set -g pane-border-style "fg=#3D4F5C"
  71. # set -g pane-active-border-style "fg=#3D4F5C"
  72. # List of plugins
  73. set -g @plugin 'tmux-plugins/tpm'
  74. set -g @plugin 'tmux-plugins/tmux-sensible'
  75. # set -g @plugin "janoamaral/tokyo-night-tmux"
  76. # set -g @tokyo-night-tmux_window_id_style digital
  77. set -g @plugin 'Nybkox/tmux-kanagawa'
  78. set -g @kanagawa-show-powerline true
  79. set -g @kanagawa-theme 'wave'
  80. # set -g @plugin 'jibingeo/tmux-colors-ayu'
  81. # set -g @plugin 'egel/tmux-gruvbox'
  82. # set -g @tmux-gruvbox 'dark' # or 'light'
  83. # set -g @plugin 'catppuccin/tmux'
  84. # set -g @catppuccin_flavour 'mocha'
  85. # set -g @catppuccin_status_left_separator ""
  86. # set -g @catppuccin_window_middle_separator " "
  87. # set -g @catppuccin_status_modules_right "application session directory date_time"
  88. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
  89. run '~/.tmux/plugins/tpm/tpm'