mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 23:49:56 +00:00
Simplify tmux config and bootstrap plugins with TPM
This commit is contained in:
@@ -1,44 +1,21 @@
|
||||
#=== KEYBINDINGS ====#
|
||||
#=== BEHAVIOR ===#
|
||||
|
||||
# change prefix
|
||||
unbind C-b
|
||||
set -g prefix C-a
|
||||
bind C-a send-prefix
|
||||
|
||||
# split panes using | and -
|
||||
bind | split-window -h
|
||||
bind - split-window -v
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
# 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
|
||||
|
||||
# switch windows using Alt-<number> without prefix
|
||||
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
|
||||
|
||||
# Other session shortcuts
|
||||
bind S command-prompt -p "New Session:" "new-session -A -s '%%'"
|
||||
bind K confirm kill-session
|
||||
set-option -g detach-on-destroy off
|
||||
|
||||
#=== LAYOUT ====#
|
||||
set -g renumber-window on
|
||||
set -g base-index 1
|
||||
setw -g pane-base-index 1
|
||||
bind c new-window -c '#{pane_current_path}'
|
||||
|
||||
# Enable mouse control (clickable windows, panes, resizable panes)
|
||||
set -g mouse on
|
||||
|
||||
# Fix Tmux for colors
|
||||
bind-key c new-window -c '#{pane_current_path}'
|
||||
bind-key -n M-Left select-pane -L
|
||||
bind-key -n M-Right select-pane -R
|
||||
bind-key -n M-Up select-pane -U
|
||||
bind-key -n M-Down select-pane -D
|
||||
|
||||
# Session popup: Enter switches, Ctrl-k kills, Ctrl-n creates.
|
||||
bind-key S display-popup -E -w 80% -h 80% "~/.tmux/bin/session-popup '#{pane_current_path}'"
|
||||
|
||||
#=== TERMINAL ===#
|
||||
|
||||
set -g default-terminal "screen-256color"
|
||||
set -ag terminal-features ',screen-256color:RGB,tmux*:RGB,alacritty:RGB,foot:RGB,xterm-256color:RGB,gnome*:RGB'
|
||||
set -g allow-passthrough on
|
||||
@@ -46,15 +23,15 @@ set -ga update-environment TERM
|
||||
set -ga update-environment TERM_PROGRAM
|
||||
|
||||
#=== PLUGINS ===#
|
||||
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'sei40kr/tmux-project'
|
||||
set-option -g @plugin 'b0o/tmux-autoreload'
|
||||
set -g @plugin 'b0o/tmux-autoreload'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||
|
||||
#=== THEME: Yaru Blue Dark ===#
|
||||
# palette
|
||||
|
||||
set -g @yaru_bg "#2b2b2e"
|
||||
set -g @yaru_bg_light "#3b3b3e"
|
||||
set -g @yaru_fg "#e0e0e0"
|
||||
@@ -66,11 +43,10 @@ set -g @yaru_sep "#4a4a52"
|
||||
set -g @yaru_red "#c7162b"
|
||||
set -g @yaru_green "#4caf50"
|
||||
|
||||
# status bar
|
||||
set -g status-position top
|
||||
set -g status-style "bg=#{@yaru_bg}"
|
||||
set -g status-left-length 120
|
||||
set -g status-right-length 120
|
||||
set -g status-right-length 80
|
||||
|
||||
set -g status-left ""
|
||||
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_blue},bold] #S "
|
||||
@@ -82,22 +58,18 @@ set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_sep}]#{?window_zoomed_flag,│,
|
||||
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_orange}]#{?window_zoomed_flag, zoom ,}"
|
||||
|
||||
set -g status-right ""
|
||||
set -g status-right '#(gitmux "#{pane_current_path}") '
|
||||
set -ga status-right "#[bg=#{@yaru_bg},fg=#{@yaru_sep}]│"
|
||||
set -ga status-right "#[bg=#{@yaru_bg},fg=#{@yaru_blue_b}] #H"
|
||||
|
||||
# pane borders
|
||||
setw -g pane-border-status off
|
||||
setw -g pane-active-border-style "fg=#{@yaru_blue}"
|
||||
setw -g pane-border-style "fg=#{@yaru_sep}"
|
||||
setw -g pane-border-lines single
|
||||
|
||||
# message and mode
|
||||
set -g message-style "bg=#{@yaru_blue},fg=#{@yaru_bg},bold"
|
||||
set -g message-command-style "bg=#{@yaru_blue},fg=#{@yaru_bg},bold"
|
||||
set -g mode-style "bg=#{@yaru_orange},fg=#{@yaru_bg},bold"
|
||||
|
||||
# window status
|
||||
set -g window-status-format " #I:#{?#{!=:#{window_name},Window},#W,} "
|
||||
set -g window-status-style "bg=#{@yaru_bg},fg=#{@yaru_fg_dim}"
|
||||
set -g window-status-last-style "bg=#{@yaru_bg},fg=#{@yaru_fg}"
|
||||
@@ -107,11 +79,10 @@ set -gF window-status-separator "#[bg=#{@yaru_bg},fg=#{@yaru_sep}]│"
|
||||
set -g window-status-current-format " #I:#{?#{!=:#{window_name},Window},#W,} "
|
||||
set -g window-status-current-style "bg=#{@yaru_blue},fg=#{@yaru_bg},bold"
|
||||
|
||||
# Continuum options
|
||||
set -g @continuum-restore 'on'
|
||||
#=== SESSION RESTORE ===#
|
||||
|
||||
# Project options
|
||||
set -ag @project-base-dirs ,"${HOME}/.dotfiles","${HOME}/Projects:0:2"
|
||||
set -g @continuum-restore 'on'
|
||||
set -g @continuum-save-interval '15'
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
Reference in New Issue
Block a user