64 lines
2.0 KiB
Plaintext
64 lines
2.0 KiB
Plaintext
# Settings
|
|
set -g default-terminal "xterm-256color"
|
|
set -ag terminal-overrides ",xterm-256color:RGB"
|
|
setw -g monitor-activity on
|
|
setw -g aggressive-resize on
|
|
setw -g automatic-rename on
|
|
set -s escape-time 0
|
|
set-window-option -g xterm-keys on
|
|
set-option -g focus-events on
|
|
|
|
# Setup vi-mode with better keybindings
|
|
# TODO: Escape does not work properly for leaving
|
|
setw -g mode-keys vi
|
|
bind -T copy-mode-vi v send -X begin-selection
|
|
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
|
|
|
# Change leader
|
|
unbind C-b
|
|
set -g prefix C-a
|
|
|
|
# Improve navigation between tmux and nvim
|
|
# TODO: Disable pane selection wrap
|
|
bind-key -n M-h if -F "#{@pane-is-vim}" 'send-keys M-h' "run '#{select_pane_no_wrap} L'"
|
|
bind-key -n M-j if -F "#{@pane-is-vim}" 'send-keys M-j' "run '#{select_pane_no_wrap} D'"
|
|
bind-key -n M-k if -F "#{@pane-is-vim}" 'send-keys M-k' "run '#{select_pane_no_wrap} U'"
|
|
bind-key -n M-l if -F "#{@pane-is-vim}" 'send-keys M-l' "run '#{select_pane_no_wrap} R'"
|
|
|
|
bind-key -T copy-mode-vi 'M-h' select-pane -L
|
|
bind-key -T copy-mode-vi 'M-j' select-pane -D
|
|
bind-key -T copy-mode-vi 'M-k' select-pane -U
|
|
bind-key -T copy-mode-vi 'M-l' select-pane -R
|
|
|
|
# Custom keybinds
|
|
bind '"' split-window -c "#{pane_current_path}"
|
|
bind % split-window -h -c "#{pane_current_path}"
|
|
bind -n C-j new-window -c "#{pane_current_path}"
|
|
bind -n C-h prev
|
|
bind -n C-l next
|
|
bind -n C-M-l swap-window -t +1 \; next
|
|
bind -n C-M-h swap-window -t -1 \; prev
|
|
|
|
# Keybind for reloading config
|
|
bind r source-file $DOTFILES/tmux/dot-tmux.conf \; display-message "Config reloaded..."
|
|
|
|
bind -T root F12 \
|
|
set prefix None \;\
|
|
set key-table off \;\
|
|
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
|
|
refresh-client -S \;\
|
|
|
|
bind -T off F12 \
|
|
set -u prefix \;\
|
|
set -u key-table \;\
|
|
refresh-client -S
|
|
|
|
wg_is_keys_off="#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'TRUE' )"
|
|
|
|
# Load theme
|
|
source-file "$DOTFILES/tmux/gruvbox.conf"
|
|
|
|
set -g @plugin "dalejung/tmux-select-pane-no-wrap"
|
|
|
|
run "$DOTFILES/tmux/tpm/tpm"
|