diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2025-05-09 10:32:49 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2025-05-09 10:32:49 -0500 |
| commit | ec1b8485101c5c1512c58fb3e777d8eed7a0f5f4 (patch) | |
| tree | a1204931573b836e6cee46a670d115b1fa1dbe7c | |
| parent | tweak install script (diff) | |
| download | dotfiles-ec1b8485101c5c1512c58fb3e777d8eed7a0f5f4.zip | |
rework tmux configs
| -rw-r--r-- | tmux/.config/tmux/key-remappings.conf | 21 | ||||
| -rw-r--r-- | tmux/.config/tmux/options.conf | 26 | ||||
| -rw-r--r-- | tmux/.config/tmux/plugins.conf | 25 | ||||
| -rw-r--r-- | tmux/.config/tmux/theme.conf | 32 | ||||
| -rw-r--r-- | tmux/.config/tmux/tmux.conf | 97 | ||||
| -rw-r--r-- | tmux/.config/tmux/vi.conf | 8 |
6 files changed, 123 insertions, 86 deletions
diff --git a/tmux/.config/tmux/key-remappings.conf b/tmux/.config/tmux/key-remappings.conf new file mode 100644 index 0000000..1a6cfde --- /dev/null +++ b/tmux/.config/tmux/key-remappings.conf @@ -0,0 +1,21 @@ +# Start from a blank slate. Unremap all default key bindings. +# unbind-key -a + +# Remap prefix from 'C-b' to 'C-a' +# +# This works well if you remap the regular Caps Lock key to Ctrl. +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix + +# Remap pane splits. +# +# Split panes using | for horizontal splits and - for vertical splits +bind-key | split-window -h +bind-key - split-window -v +unbind '"' +unbind % + +bind-key r source-file ~/.config/tmux/tmux.conf +bind-key x kill-pane + diff --git a/tmux/.config/tmux/options.conf b/tmux/.config/tmux/options.conf new file mode 100644 index 0000000..a06803b --- /dev/null +++ b/tmux/.config/tmux/options.conf @@ -0,0 +1,26 @@ +# Don't rename windows automatically. +# +# I often will use the `,` key to rename windows. +# However, by default, tmux will update the window +# title to the last executed command. +set-option -g allow-rename off + +# Enable mouse support (clickable windows, panes, resizable panes) +set-option -g mouse on + +# Set terminal colors +# set-option -g default-terminal "screen-256color" + +# Start windows and panes at 1, not 0 +set-option -g base-index 1 +set-option -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +# Don't do anything when a 'bell' rings +set-option -g visual-activity off +set-option -g visual-bell off +set-option -g visual-silence off +set-window-option -g monitor-activity off +set-option -g bell-action none + diff --git a/tmux/.config/tmux/plugins.conf b/tmux/.config/tmux/plugins.conf new file mode 100644 index 0000000..ee2de5e --- /dev/null +++ b/tmux/.config/tmux/plugins.conf @@ -0,0 +1,25 @@ +# Plugin manager +set-option -g @plugin 'tmux-plugins/tpm' + +# 'Sensible' set of defaults +set-option -g @plugin 'tmux-plugins/tmux-sensible' + +TMUX_FZF_ORDER="session|window|pane|command|keybinding" +TMUX_FZF_OPTIONS="-p -w 90% -h 70% -m" +set-option -g @plugin 'sainnhe/tmux-fzf' + +# Persist tmux sessions across system restarts +set-option -g @plugin 'tmux-plugins/tmux-resurrect' +set-option -g @plugin 'tmux-plugins/tmux-continuum' +set -g @resurrect-strategy-nvim 'session' + +# set -g @plugin 'christoomey/vim-tmux-navigator' + +# Save and restore session +# set -g @resurrect-save 'S' +# set -g @resurrect-restore 'R' + +# # more options here: https://github.com/sainnhe/tmux-fzf/issues/6#issuecomment-578750879 +# bind w run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch" + +run '~/.tmux/plugins/tpm/tpm' diff --git a/tmux/.config/tmux/theme.conf b/tmux/.config/tmux/theme.conf new file mode 100644 index 0000000..f0668ae --- /dev/null +++ b/tmux/.config/tmux/theme.conf @@ -0,0 +1,32 @@ +# Clock mode +setw -g clock-mode-colour yellow + +# Copy mode +setw -g mode-style 'fg=black bg=red bold' + +set -g pane-border-style 'fg=red' +set -g pane-active-border-style 'fg=yellow' + +# Statusbar +set -g status-position bottom +set -g status-justify left +set -g status-style 'fg=red' + +set -g status-left '' +set -g status-left-length 10 + +set -g status-right-style 'fg=black bg=yellow' +set -g status-right '%Y-%m-%d %H:%M ' +set -g status-right-length 50 + +setw -g window-status-current-style 'fg=black bg=red' +setw -g window-status-current-format ' #I #W #F ' + +setw -g window-status-style 'fg=red bg=black' +setw -g window-status-format ' #I #[fg=white]#W #[fg=yellow]#F ' + +setw -g window-status-bell-style 'fg=yellow bg=red bold' + +# Messages +set -g message-style 'fg=yellow bg=red bold' + diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index 7f5851e..4783498 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -1,89 +1,14 @@ -# Remap prefix from 'C-b' to 'C-a' +# Resolve issue on macOS with homebrew installed tmux +# where it is symlinked to /usr/local/bin but tmux wants +# to look for the executable in /usr/bin when executing +# `run` commands. # -# This works well if you remap the regular -# Caps Lock key to Ctrl. -unbind C-b -set-option -g prefix C-a -bind-key C-a send-prefix +# https://github.com/tmux-plugins/tpm/issues/67#issuecomment-319561401 +set-environment -g PATH "/usr/local/bin:/bin:/usr/bin" -# More intuitive pane splits. -# -# Split panes using | for horizontal splits -# and - for vertical splits -bind | split-window -h -bind - split-window -v -unbind '"' -unbind % +source-file ~/.config/tmux/key-remappings.conf +source-file ~/.config/tmux/options.conf +source-file ~/.config/tmux/vi.conf +source-file ~/.config/tmux/theme.conf +source-file ~/.config/tmux/plugins.conf -# Enable faster pane switching -# -# 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 - -# Set terminal colors -set-option -sa terminal-overrides ",xterm*:Tc" - -# Enable mouse support (clickable windows, panes, resizable panes) -set -g mouse on - -# Start 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 - -# kill pane -bind-key x kill-pane - -# Pane resizing -# bind -n M-h resize-pane -L -# bind -n M-l resize-pane -R -# bind -n M-k resize-pane -U -# bind -n M-j resize-pane -D -# -# # Move window to the left -# bind -n M-i swap-window -t -1 -# -# # Move window to the right -# bind -n M-o swap-window -t +1 -# -# Set vi mode -set-window-option -g mode-keys vi - -# Use visual selection mode as vi -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 - -# Save and restore session -# set -g @resurrect-save 'S' -# set -g @resurrect-restore 'R' - -# Tmux theme -# set -g @catppuccin_flavour 'mocha' -# set -g @catppuccin_right_separator "█" -# set -g @catppuccin_left_separator "█" -# -# TMUX_FZF_ORDER="session|window|pane|command|keybinding" -# TMUX_FZF_OPTIONS="-p -w 90% -h 70% -m" - -# # more options here: https://github.com/sainnhe/tmux-fzf/issues/6#issuecomment-578750879 -# bind w run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch" - -# Plugins -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' - -# set -g @plugin 'tmux-plugins/tpm' -# set -g @plugin 'tmux-plugins/tmux-sensible' -# set -g @plugin 'sainnhe/tmux-fzf' -# set -g @plugin 'christoomey/vim-tmux-navigator' -# set -g @plugin 'oca159/catppuccin-tmux' -# set -g @plugin 'tmux-plugins/tmux-resurrect' -# set -g @plugin 'tmux-plugins/tmux-continuum' -# set -g @resurrect-strategy-nvim 'session' -# -run '~/.tmux/plugins/tpm/tpm' diff --git a/tmux/.config/tmux/vi.conf b/tmux/.config/tmux/vi.conf new file mode 100644 index 0000000..6592f10 --- /dev/null +++ b/tmux/.config/tmux/vi.conf @@ -0,0 +1,8 @@ +# Set vi mode +set-window-option -g mode-keys vi + +# Use visual selection mode as vi +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 + |