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