mirror of
https://github.com/anthonyoteri/dotfiles.git
synced 2026-06-05 15:46:54 -04:00
feat: improve tmux config
This commit is contained in:
+77
-14
@@ -1,26 +1,63 @@
|
|||||||
# Set up the terminal overrides
|
# =============================================================
|
||||||
|
# Tmux Configuration - Gruvbox Dark, Vim Navigation, Fast Clipboard, Minimal Plugins
|
||||||
|
#
|
||||||
|
# Features:
|
||||||
|
# - Gruvbox dark theme for status bar and UI
|
||||||
|
# - Vim-style navigation and pane resizing
|
||||||
|
# - Mouse support and fast copy-paste
|
||||||
|
# - Minimal, fast plugin setup
|
||||||
|
# =============================================================
|
||||||
|
# Fast pane splitting shortcuts (already present)
|
||||||
|
# Copy-paste integration (already present with tmux-yank and set-clipboard)
|
||||||
|
# Plugin setup is minimal and fast with TPM and sensible plugins
|
||||||
|
|
||||||
|
# Additional: Make pane resizing easier with vim-style keys
|
||||||
|
bind -r h resize-pane -L 5
|
||||||
|
bind -r j resize-pane -D 5
|
||||||
|
bind -r k resize-pane -U 5
|
||||||
|
bind -r l resize-pane -R 5
|
||||||
|
# Gruvbox color palette
|
||||||
|
set -g @gruvbox_fg '#ebdbb2'
|
||||||
|
set -g @gruvbox_bg '#282828'
|
||||||
|
set -g @gruvbox_yellow '#fabd2f'
|
||||||
|
set -g @gruvbox_blue '#458588'
|
||||||
|
set -g @gruvbox_red '#cc241d'
|
||||||
|
set -g @gruvbox_green '#98971a'
|
||||||
|
set -g @gruvbox_orange '#d79921'
|
||||||
|
|
||||||
|
# Status bar customization
|
||||||
|
set -g status-bg '#282828'
|
||||||
|
set -g status-fg '#ebdbb2'
|
||||||
|
set -g status-left-length 40
|
||||||
|
set -g status-right-length 100
|
||||||
|
set -g status-interval 2
|
||||||
|
|
||||||
|
set -g status-left "#[fg=#fabd2f,bg=#282828,bold] #S #[fg=#282828,bg=#fabd2f,nobold] #[fg=#ebdbb2,bg=#fabd2f] #(whoami)@#H #[fg=#fabd2f,bg=#282828] #[fg=#ebdbb2,bg=#282828] #(basename #{pane_current_path}) "
|
||||||
|
|
||||||
|
set -g status-right "#[fg=#fabd2f,bg=#282828]#[fg=#282828,bg=#fabd2f] #(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo '-') #[fg=#fabd2f,bg=#282828]#[fg=#ebdbb2,bg=#282828] %Y-%m-%d %H:%M "
|
||||||
|
# --- Terminal & Compatibility ---
|
||||||
|
# Use 256-color mode and ensure compatibility with xterm
|
||||||
set-option -g default-terminal 'screen-256color'
|
set-option -g default-terminal 'screen-256color'
|
||||||
set-option -sa terminal-overrides ",xterm-256color:RGB"
|
set-option -sa terminal-overrides ",xterm-256color:RGB"
|
||||||
|
|
||||||
# Enable mouse support
|
# --- Mouse & Key Bindings ---
|
||||||
|
# Enable mouse support for pane/window selection and resizing
|
||||||
set -g mouse on
|
set -g mouse on
|
||||||
|
|
||||||
# Set prefix to Ctrl+Space
|
# (Optional) Change prefix to Ctrl+Space instead of default Ctrl+B
|
||||||
#unbind C-b
|
|
||||||
#set -g prefix C-Space
|
|
||||||
#bind C-Space send-prefix
|
|
||||||
|
|
||||||
# Shift Alt vim keys to switch windows
|
# Alt+Shift+H/L to switch windows (vim-style)
|
||||||
bind -n M-H previous-window
|
bind -n M-H previous-window
|
||||||
bind -n M-L next-window
|
bind -n M-L next-window
|
||||||
|
|
||||||
# Start windows and panes at 1, not 0
|
# Start windows and panes at 1 for easier navigation
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
set -g pane-base-index 1
|
set -g pane-base-index 1
|
||||||
set-window-option -g pane-base-index 1
|
set-window-option -g pane-base-index 1
|
||||||
set-option -g renumber-windows on
|
set-option -g renumber-windows on
|
||||||
|
|
||||||
# Miscellaneous settings
|
# --- Miscellaneous ---
|
||||||
|
# Various usability and performance tweaks
|
||||||
set -g detach-on-destroy off # don't exit from tmux when closing a session
|
set -g detach-on-destroy off # don't exit from tmux when closing a session
|
||||||
set -g escape-time 0 # zero-out escape time delay
|
set -g escape-time 0 # zero-out escape time delay
|
||||||
set -g history-limit 1000000 # increase history size
|
set -g history-limit 1000000 # increase history size
|
||||||
@@ -28,22 +65,36 @@ set -g set-clipboard on # use system clipboard
|
|||||||
set -g status-position top # macOS / darwin style
|
set -g status-position top # macOS / darwin style
|
||||||
set -g default-terminal "${TERM}"
|
set -g default-terminal "${TERM}"
|
||||||
|
|
||||||
# Set vi-mode
|
# --- Copy & Selection ---
|
||||||
|
# Use vi-style keys in copy mode
|
||||||
set-window-option -g mode-keys vi
|
set-window-option -g mode-keys vi
|
||||||
|
|
||||||
# Keybindings
|
# Keybindings for copy mode (vim-style selection and yanking)
|
||||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
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 C-v send-keys -X rectangle-toggle
|
||||||
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
||||||
|
|
||||||
# Open panes in current directory
|
# Split panes in the current working directory
|
||||||
bind '"' split-window -v -c "#{pane_current_path}"
|
bind '"' split-window -v -c "#{pane_current_path}"
|
||||||
bind % split-window -h -c "#{pane_current_path}"
|
bind % split-window -h -c "#{pane_current_path}"
|
||||||
|
|
||||||
# Pane separators
|
# Use double lines for pane borders
|
||||||
set -g pane-border-lines double
|
set -g pane-border-lines double
|
||||||
|
|
||||||
# Configure Tmux plugins
|
# --- Plugins ---
|
||||||
|
# Plugin Manager (TPM) and useful plugins:
|
||||||
|
# tmux-plugins/tpm - Plugin manager
|
||||||
|
# tmux-plugins/tmux-sensible - Sensible defaults
|
||||||
|
# tmux-plugins/tmux-yank - Fast copy to clipboard
|
||||||
|
# tmux-plugins/tmux-resurrect - Save/restore sessions
|
||||||
|
# tmux-plugins/tmux-continuum - Auto-save sessions
|
||||||
|
# fcsonline/tmux-thumbs - Fuzzy select text
|
||||||
|
# sainnhe/tmux-fzf - Fuzzy find in tmux
|
||||||
|
# wfxr/tmux-fzf-url - Fuzzy find URLs
|
||||||
|
# egel/tmux-gruvbox - Gruvbox theme
|
||||||
|
# christoomey/vim-tmux-navigator - Vim navigation between panes
|
||||||
|
# omerxx/tmux-sessionx - Session management
|
||||||
|
# omerxx/tmux-floax - Floating windows
|
||||||
set -g @plugin 'tmux-plugins/tpm'
|
set -g @plugin 'tmux-plugins/tpm'
|
||||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||||
@@ -57,11 +108,15 @@ set -g @plugin 'christoomey/vim-tmux-navigator'
|
|||||||
set -g @plugin 'omerxx/tmux-sessionx'
|
set -g @plugin 'omerxx/tmux-sessionx'
|
||||||
set -g @plugin 'omerxx/tmux-floax'
|
set -g @plugin 'omerxx/tmux-floax'
|
||||||
|
|
||||||
|
|
||||||
|
# Floax plugin settings (floating windows)
|
||||||
set -g @floax-width '80%'
|
set -g @floax-width '80%'
|
||||||
set -g @floax-height '80%'
|
set -g @floax-height '80%'
|
||||||
set -g @floax-bind 'p'
|
set -g @floax-bind 'p'
|
||||||
set -g @floax-change-path 'true'
|
set -g @floax-change-path 'true'
|
||||||
|
|
||||||
|
|
||||||
|
# Sessionx plugin settings (session management)
|
||||||
set -g @sessionx-x-path '~/dotfiles'
|
set -g @sessionx-x-path '~/dotfiles'
|
||||||
set -g @sessionx-window-height '85%'
|
set -g @sessionx-window-height '85%'
|
||||||
set -g @sessionx-window-width '75%'
|
set -g @sessionx-window-width '75%'
|
||||||
@@ -69,10 +124,18 @@ set -g @sessionx-zoxide-mode 'on'
|
|||||||
set -g @sessionx-custom-paths-subdirectories 'false'
|
set -g @sessionx-custom-paths-subdirectories 'false'
|
||||||
set -g @sessionx-filter-current 'false'
|
set -g @sessionx-filter-current 'false'
|
||||||
|
|
||||||
|
|
||||||
|
# Continuum plugin: auto-restore sessions
|
||||||
set -g @continuum-restore 'on'
|
set -g @continuum-restore 'on'
|
||||||
|
|
||||||
|
|
||||||
|
# Resurrect plugin: save/restore nvim sessions
|
||||||
set -g @resurrect-strategy-nvim 'session'
|
set -g @resurrect-strategy-nvim 'session'
|
||||||
|
|
||||||
|
|
||||||
|
# Gruvbox theme plugin: use dark mode
|
||||||
set -g @tmux-gruvbox 'dark'
|
set -g @tmux-gruvbox 'dark'
|
||||||
|
|
||||||
|
|
||||||
|
# Initialize TPM (Tmux Plugin Manager)
|
||||||
run '~/.tmux/plugins/tpm/tpm'
|
run '~/.tmux/plugins/tpm/tpm'
|
||||||
|
|||||||
Reference in New Issue
Block a user