dotfiles/tmux/dot-tmux.conf

73 lines
2.2 KiB
Plaintext

# Plugins
set -g @plugin 'mrjones2014/smart-splits.nvim'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Settings
set -ag terminal-overrides ",xterm-256color:RGB"
setw -g monitor-activity on
setw -g automatic-rename on
set-window-option -g xterm-keys 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
bind -T copy-mode-vi Escape send-keys -X cancel
# Change leader
unbind C-b
set -g prefix C-a
# Improve navigation between tmux and nvim
set -g @smart-splits_no_wrap '' # to disable wrapping. (any value disables wrapping)
set -g @smart-splits_move_left_key 'M-h' # key-mapping for navigation.
set -g @smart-splits_move_down_key 'M-j' # --"--
set -g @smart-splits_move_up_key 'M-k' # --"--
set -g @smart-splits_move_right_key 'M-l' # --"--
set -g @smart-splits_resize_left_key 'M-left' # key-mapping for resizing.
set -g @smart-splits_resize_down_key 'M-down' # --"--
set -g @smart-splits_resize_up_key 'M-up' # --"--
set -g @smart-splits_resize_right_key 'M-right' # --"--
# Custom keybinds
bind s split-window -c "#{pane_current_path}"
bind v 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
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"
run "$DOTFILES/tmux/tpm/tpm"
set -g base-index 1
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
bind-key -n M-0 select-window -t 10