Files
hyprland/config/tmux/binds.conf
T

65 lines
1.8 KiB
Plaintext

# Set prefix
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Set vi-mode
set-window-option -g mode-keys vi
# easy reload config
bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded..."
# Alt vim keys to switch windows
bind -n M-h previous-window
bind -n M-l next-window
# Choose Window
bind-key '"' choose-window
# Resize Pane
bind-key + resize-pane -Z
# Detach Session
bind-key d detach
# cycle thru MRU tabs
bind-key -r Tab last-window
# New session
bind-key N command-prompt -p "Enter session name:" "new-session -s '%%'"
# Rename current session
bind R command-prompt -p "Enter session name:" "rename-session '%%'"
# Rename Window
bind-key W command-prompt -I "Enter window name:" "rename-window '%%'"
# Open panes in current directory
bind - split-window -c '#{pane_current_path}'
bind / split-window -h -c '#{pane_current_path}'
#Lagygit
bind-key G popup -w90% -h90% -E "lazygit"
bind-key z popup -w50% -h50% -E "yazi"
bind-key -n C-b popup -w55% -h50% -E "btop"
# Copy Mode
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-selection-and-cancel
# Resize Pane
bind-key -r h resize-pane -L
bind-key -r l resize-pane -R
bind-key -r j resize-pane -D
bind-key -r k resize-pane -U
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"