| 1 | # fIX TERMINAL |
| 2 | set-option -ga terminal-overrides ",xterm-256color:Tc:allow-passthrough" |
| 3 | set -g xterm-keys on |
| 4 | set -g allow-passthrough on |
| 5 | set -ga update-environment TERM |
| 6 | set -ga update-environment TERM_PROGRAM |
| 7 | set -g history-limit 4000 |
| 8 | |
| 9 | # Enable clipboard for wayland |
| 10 | set-option -g set-clipboard on |
| 11 | bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy" |
| 12 | bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "wl-copy" |
| 13 | |
| 14 | # Style unused terminal panes |
| 15 | set -g window-style 'fg=colour247,bg=colour236' |
| 16 | set -g window-active-style 'fg=colour250,bg=black' |
| 17 | set -g pane-border-lines "double" |
| 18 | |
| 19 | # Vim keys in copy mode |
| 20 | set -g mode-keys vi |
| 21 | |
| 22 | # Automatic continuum-restore |
| 23 | set -g @continuum-restore 'on' |
| 24 | |
| 25 | # Automatic window name |
| 26 | setw -g automatic-rename-format "#{b:pane_current_path}" |
| 27 | |
| 28 | # Automatic pane name that also allows custom pane title in the beginning |
| 29 | set -g pane-border-status top |
| 30 | |
| 31 | # Rename pane keybinding (yes select-pane is misleading) |
| 32 | bind r command-prompt -I "" "select-pane -T '%%'" |
| 33 | |
| 34 | # Easier to enter scroll mode |
| 35 | bind -n C-0 copy-mode |
| 36 | |
| 37 | # Set the session to the current pane's directory |
| 38 | bind a attach -c "#{pane_current_dir}" |
| 39 | |
| 40 | # Close pane with alt q |
| 41 | bind -n M-q kill-pane |
| 42 | |
| 43 | # New panes with alt |
| 44 | bind -n M-n split-window -v |
| 45 | bind -n M-N split-window -h |
| 46 | |
| 47 | # Vim like resizing with shift alt |
| 48 | bind -n M-H resize-pane -L 5 |
| 49 | bind -n M-J resize-pane -D 5 |
| 50 | bind -n M-K resize-pane -U 5 |
| 51 | bind -n M-L resize-pane -R 5 |
| 52 | |
| 53 | # Vim like movements with alt |
| 54 | bind -n M-h select-pane -L |
| 55 | bind -n M-l select-pane -R |
| 56 | bind -n M-k select-pane -U |
| 57 | bind -n M-j select-pane -D |
| 58 | |
| 59 | # Zoom with simple alt f |
| 60 | bind -n M-f resize-pane -Z |
| 61 | |
| 62 | # New stuff opens in same directory as starting pane |
| 63 | bind \" split-window -c "#{pane_current_path}" |
| 64 | bind % split-window -h -c "#{pane_current_path}" |
| 65 | bind c new-window -c "#{pane_current_path}" |
| 66 | |
| 67 | # No more confirmation to close things |
| 68 | bind x kill-pane |
| 69 | bind & kill-window |
| 70 | |
| 71 | # Remove accidental cycle windows |
| 72 | unbind -T prefix Space |
| 73 | |
| 74 | # popups |
| 75 | bind h display-popup -E -w 95% -h 95% -T "Htop" htop |
| 76 | bind g display-popup -E -w 95% -h 95% -T "Lazygit" -d "#{pane_current_path}" lazygit |
| 77 | bind D display-popup -E -w 95% -h 95% -T "Docker Stats" docker stats |
| 78 | bind S display-popup -E -w 95% -h 95% -T "System" systemctl-tui |
| 79 | bind u display-popup -E -w 95% -h 95% -T "Upload Dotfiles" -d "$HOME/.dotfiles" "$HOME/.dotfiles/sync-then-lazygit.sh" |
| 80 | |
| 81 | # Resurrect settings |
| 82 | set -g @continuum-save-interval '10' |
| 83 | set -g @resurrect-processes 'false' |
| 84 | # Force continuum save via hook since powerline owns status-right |
| 85 | set-hook -g pane-focus-in 'run-shell -b "~/.config/tmux/plugins/tmux-continuum/scripts/continuum_save.sh"' |
| 86 | |
| 87 | # List of plugins |
| 88 | set -g @plugin 'tmux-plugins/tpm' |
| 89 | set -g @plugin 'tmux-plugins/tmux-sensible' |
| 90 | set -g @plugin 'tmux-plugins/tmux-resurrect' |
| 91 | set -g @plugin 'tmux-plugins/tmux-continuum' |
| 92 | set -g @plugin 'erikw/tmux-powerline' |
| 93 | set -g @plugin 'huncholane/tmux-fzf-keys' |
| 94 | set -g @plugin 'omerxx/tmux-sessionx' |
| 95 | set -g @plugin 'Morantron/tmux-fingers' |
| 96 | |
| 97 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) |
| 98 | run '~/.config/tmux/bootstrap-tpm.sh' |