47 lines
1.5 KiB
Bash
47 lines
1.5 KiB
Bash
set -g @plugin 'tmux-plugins/tpm' # tmux plugin manager
|
|
set -g @plugin 'tmux-plugins/tmux-sensible' # sensible defaults for tmux
|
|
set -g @plugin 'catppuccin/tmux' # tmux theme
|
|
set -g @plugin 'tmux-plugins/tmux-resurrect' # save/restore tmux sessions
|
|
set -g @plugin 'tmux-plugins/tmux-continuum' # autosave tmux sessions
|
|
|
|
# tmux-resurrect
|
|
set -g @resurrect-strategy-nvim 'session' # save nvim sessions
|
|
set -g @resurrect-capture-pane-contents 'on' # capture tmux panes
|
|
set -g @continuum-restore 'on' # automatically restore tmux session on server start
|
|
|
|
run '~/.tmux/plugins/tpm/tpm'
|
|
|
|
# set terminal colors to 24-bit
|
|
set-option -sa terminal-overrides ",xterm*:Tc"
|
|
# use zsh
|
|
set-option -g default-shell /bin/zsh
|
|
# enable mouse mode
|
|
set -g mouse on
|
|
# vi keys for navigation
|
|
set-window-option -g mode-keys vi
|
|
|
|
# copy mode and clipboard
|
|
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
|
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
|
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
|
bind-key v copy-mode
|
|
set -g set-clipboard on
|
|
set -as terminal-feature ',*:clipboard'
|
|
set -s copy-command 'xsel -i -b'
|
|
|
|
# vim style pane
|
|
bind h select-pane -L
|
|
bind j select-pane -D
|
|
bind k select-pane -U
|
|
bind l select-pane -R
|
|
bind M-h resize-pane -L 10
|
|
bind M-j resize-pane -D 10
|
|
bind M-k resize-pane -U 10
|
|
bind M-l resize-pane -R 10
|
|
|
|
# open new panes/windows in current path
|
|
bind '"' split-window -c "#{pane_current_path}"
|
|
bind % split-window -h -c "#{pane_current_path}"
|
|
bind c new-window -c "#{pane_current_path}"
|
|
|