Files
dotfiles/.config/tmux/tmux.conf
T
2024-01-18 15:51:29 -05:00

88 lines
2.4 KiB
Bash

# -- General
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
set -g default-terminal "xterm-256color"
setw -g xterm-keys on
set -sg repeat-time 600
set -q -g status-utf8 on
setw -q -g utf8 on
#set-option -g default-shell /usr/bin/fish
set-option -g default-shell /home/anthony/.cargo/bin/nu
set -g set-clipboard on
# -- Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-pain-control'
# -- Set windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# -- Use Alt-arrow keys without prefix to switch panes
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
# -- Shift-arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# -- Layout and Theme
set -g status-position top # macOS / darwin style
set -g @catppuccin_flavour 'mocha'
# -- Activity
set -g monitor-activity on
set -g visual-activity off
# -- Set vi-mode
set-window-option -g mode-keys vi
# -- Copy / Paste
# copy to X11 clipboard
if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
# copy to macOS clipboard
if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | pbcopy"'
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# copy to Windows clipboard
if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | clip.exe"'
if -b '[ -c /dev/clipboard ]' 'bind y run -b "tmux save-buffer - > /dev/clipboard"'
# -- Key bindings
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
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind b list-buffers
bind p paste-buffer
bind P choose-buffer
# -- Run tmux plugins (always at end of the file)
run '~/.tmux/plugins/tpm/tpm'