dotfiles/tmux/.tmux.conf
2024-08-19 17:03:43 -06:00

152 lines
4.1 KiB
Plaintext

# Errol Sancaktar - Tmux Config
set -g default-terminal "screen-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
# Disable Right Click Menu
unbind -n MouseDown3Pane
# History
set-option -g history-limit 50000
bind \; command-prompt
# Set ZSH
set -g default-shell /bin/zsh
bind -r C-Down resize-pane -D 5
bind -r C-Up resize-pane -U 5
bind -r C-Left resize-pane -L 5
bind -r C-Right resize-pane -R 5
bind -r m resize-pane -Z
# switch panes using Alt-arrow without prefix
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
# Marking
bind \` switch-client -t'{marked}' # Switch to marked Pane
## Pane/Window Management
# Pane Numbering
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
unbind % #unbind Horizontal Split
unbind '"' # unbind Vertical Split
# Splits
bind-key "|" split-window -h -c "#{pane_current_path}"
bind-key "\\" split-window -fh -c "#{pane_current_path}"
bind -n IC split-window -h # Split Horizontal with Insert
bind-key "-" split-window -v -c "#{pane_current_path}"
bind-key "_" split-window -fv -c "#{pane_current_path}"
bind j choose-window 'join-pane -h -s "%%"'
bind J choose-window 'join-pane -s "%%"'
bind END kill-window # Kill active window
bind Space kill-pane # Kill Active pane
bind c new-window -c "#{pane_current_path}" # Keep Path
bind -n C-f last-window
bind - split-window -v
bind C-l send-keys 'C-l' # Fix Clear Screen
unbind r
bind r source-file ~/.tmux.conf\; display "Reloaded"
bind-key h split-window -h "vim ~/scratch/notes.md"
# Select Window (Mac)
bind-key -n ¡ select-window -t 1
bind-key -n ™ select-window -t 2
bind-key -n £ select-window -t 3
bind-key -n ¢ select-window -t 4
bind-key -n ∞ select-window -t 5
bind-key -n § select-window -t 6
# Select Window (Linux)
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
# Swap Window
bind -r "<" swap-window -d -t -1
bind -r ">" swap-window -d -t +1
set -g mouse on
set-window-option -g mode-keys vi
#bind-key -T copy-mode-vi 'v' send -X begin-selection
#bind-key -T copy-mode-vi 'y' send -X copy-selection
if-shell "uname | grep -q Darwin" {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
} {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
}
unbind -T copy-mode-vi MouseDragEnd1Pane
# Page up/Down
bind -n S-Pageup send-keys S-Pageup
bind -n S-Pagedown send-keys S-Pagedown
set -g status-right '#[fg=white]#(hostname)@#(host `hostname` | cut -d " " -f 4)'
# SPOTIFY
unbind s
bind s run -b '~/.tmux/spotify-tmux.sh >/dev/null'\; display-message "Spotify: Starting"
bind -n C-n run -b '~/.tmux/spotify-tmux.sh n >/dev/null' \; display-message "Spotify: Next"
bind -n C-p run -b '~/.tmux/spotify-tmux.sh p >/dev/null' \; display-message "Spotify: Previous"
bind -n C-Space run -b '~/.tmux/spotify-tmux.sh s >/dev/null' \; display-message "Spotify Play/Pause"
# PLUGIN Management
if-shell "uname | grep -q Darwin" {
set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin"
}
# tpm plugin manager
set -g @plugin 'tmux-plugins/tpm'
# list of tmux plugins
#set -g @plugin 'christoomey/vim-tmux-navigator'
#set -g @plugin 'jimeh/tmux-themepack'
#set-option -g @plugin 'b0o/tmux-autoreload'
#set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @themepack 'powerline/default/cyan'
#set -g @resurrect-capture-pane-contents 'on'
#set -g @continuum-restore 'off'
# SPOTIFY
set -g @plugin 'xamut/tmux-spotify
run-shell "~/.tmux/plugins/tmux-spotify/tmux-spotify.tmux"
# initialize tmux plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
run-shell '~/.tmux/plugins/tpm/tpm'