dotfiles/.config/tmux/tmux.conf

65 lines
1.8 KiB
Plaintext

# If you're running an older version of tmux, use:
# ln -s $XDG_CONFIG_HOME/tmux/tmux.conf ~/.tmux.conf
# Thanks:
# https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# https://git.sr.ht/~seirdy/dotfiles/tree/HEAD/item/.config/tmux/tmux.conf
set -g default-terminal "tmux-256color"
# No delay between hitting <ESC>
set-option -s escape-time 0
# Mouse support
set-option -g mouse on
# Start with 1 instead of 0
set -g base-index 1
set -g pane-base-index 1
# Panes
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Windows
bind c new-window -c "#{pane_current_path}"
bind -n M-S-Right select-window -n
bind -n M-S-Left select-window -p
# set-option -g allow-rename off # Don't autorename windows
set -g renumber-windows on
# Show menu of URLs to open from the visible pane - needs `urlview'
bind u capture-pane \;\
save-buffer /tmp/tmux-buffer \;\
split-window -l 10 "urlscan /tmp/tmux-buffer"
# Allow programs with their own scrollback to scroll properly
bind-key -n WheelUpPane \
if-shell -Ft= "#{?pane_active,0,1}" "select-pane -t=" \; \
if-shell -Ft= "#{pane_in_mode}" \
"send-keys -M ; send-keys -M ; send-keys -M" \
"if-shell -Ft= \"#{mouse_any_flag}\" \
\"send-keys -M\" \
\"if-shell -Ft= '#{alternate_on}' \
'send-keys Up Up Up' \
'copy-mode -e'\""
bind-key -n WheelDownPane \
if-shell -Ft= "#{?pane_active,0,1}" "select-pane -t=" \; \
if-shell -Ft= "#{pane_in_mode}" \
"send-keys -M ; send-keys -M ; send-keys -M" \
"if-shell -Ft= \"#{mouse_any_flag}\" \
\"send-keys -M\" \
\"if-shell -Ft= '#{alternate_on}' \
'send-keys Down Down Down'\""