config/tmux.conf

64 lines
2.3 KiB
Text
Raw Normal View History

2025-03-08 17:52:04 +01:00
unbind C-b
set -g prefix C-s
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(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-key - split-window -v -c '#{pane_current_path}'
bind-key | split-window -h -c '#{pane_current_path}'
bind c new-window -c "#{pane_current_path}"
set -g base-index 1
set -g renumber-windows on
bind-key b break-pane -d
bind-key C-j choose-tree
# Fine adjustment (1 or 2 cursor cells per bump)
bind -n S-Left if-shell "$is_vim" "send-keys S-Left" "resize-pane -L 2"
bind -n S-Right if-shell "$is_vim" "send-keys S-Right" "resize-pane -R 2"
bind -n S-Down if-shell "$is_vim" "send-keys S-Down" "resize-pane -D 1"
bind -n S-Up if-shell "$is_vim" "send-keys S-Up" "resize-pane -U 1"
# Coarse adjustment (5 or 10 cursor cells per bump)
bind -n C-Left if-shell "$is_vim" "send-keys C-Left" "resize-pane -L 10"
bind -n C-Right if-shell "$is_vim" "send-keys C-Right" "resize-pane -R 10"
bind -n C-Down if-shell "$is_vim" "send-keys C-Down" "resize-pane -D 5"
bind -n C-Up if-shell "$is_vim" "send-keys C-Up" "resize-pane -U 5"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
#bind-key -t vi-copy v begin-selection
#bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
#unbind -t vi-copy Enter
#bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
set-option -g default-terminal "screen-256color"
#source "/home/krichtof/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"
# toggle status bar visibility
if-shell '[ ! -z "$VIMRUNTIME" ]' {
set -g status off
}
# bind-key u set-option -g status
# List of plugins
# set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'