From d7c3dff9435d1eaeb2229bbef75ab88456b24670 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 4 Jul 2025 23:01:36 -0400 Subject: update tmux config --- .gitignore | 1 + tmux/.config/tmux/key-remappings.conf | 21 ---------------- tmux/.config/tmux/key-remappings.tmux | 18 ++++++++++++++ tmux/.config/tmux/macos.tmux | 14 +++++++++++ tmux/.config/tmux/options.conf | 28 ---------------------- tmux/.config/tmux/options.tmux | 38 +++++++++++++++++++++++++++++ tmux/.config/tmux/plugins.conf | 27 --------------------- tmux/.config/tmux/plugins.tmux | 45 +++++++++++++++++++++++++++++++++++ tmux/.config/tmux/theme.conf | 32 ------------------------- tmux/.config/tmux/tmux.conf | 10 ++++---- tmux/.config/tmux/vi.conf | 8 ------- tmux/.config/tmux/vi.tmux | 6 +++++ tmux/.tmux/plugins/tpm | 1 - 13 files changed, 127 insertions(+), 122 deletions(-) delete mode 100644 tmux/.config/tmux/key-remappings.conf create mode 100644 tmux/.config/tmux/key-remappings.tmux create mode 100644 tmux/.config/tmux/macos.tmux delete mode 100644 tmux/.config/tmux/options.conf create mode 100644 tmux/.config/tmux/options.tmux delete mode 100644 tmux/.config/tmux/plugins.conf create mode 100644 tmux/.config/tmux/plugins.tmux delete mode 100644 tmux/.config/tmux/theme.conf delete mode 100644 tmux/.config/tmux/vi.conf create mode 100644 tmux/.config/tmux/vi.tmux delete mode 160000 tmux/.tmux/plugins/tpm diff --git a/.gitignore b/.gitignore index c9c4802..235823d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store /tags +/tmux/.config/tmux/plugins diff --git a/tmux/.config/tmux/key-remappings.conf b/tmux/.config/tmux/key-remappings.conf deleted file mode 100644 index 1a6cfde..0000000 --- a/tmux/.config/tmux/key-remappings.conf +++ /dev/null @@ -1,21 +0,0 @@ -# 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/key-remappings.tmux b/tmux/.config/tmux/key-remappings.tmux new file mode 100644 index 0000000..2e71dfe --- /dev/null +++ b/tmux/.config/tmux/key-remappings.tmux @@ -0,0 +1,18 @@ +# 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 \; display-message "Config reloaded!" +bind-key x kill-pane + diff --git a/tmux/.config/tmux/macos.tmux b/tmux/.config/tmux/macos.tmux new file mode 100644 index 0000000..02fbde3 --- /dev/null +++ b/tmux/.config/tmux/macos.tmux @@ -0,0 +1,14 @@ +# Related: [issue #67](https://github.com/tmux-plugins/tpm/issues/67) +set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin" + +# Setting the namespace +set -g default-command "reattach-to-user-namespace -l /bin/zsh" + +# Prefix C-c copy buffer to system clipboard +bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy" + +# Prefix C-v paste system clipboard into tmux +bind C-v run "tmux set-buffer \"$(reattach-to-user-namespace pbpaste)\"; tmux paste-buffer" + +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" +bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" diff --git a/tmux/.config/tmux/options.conf b/tmux/.config/tmux/options.conf deleted file mode 100644 index ac1cb84..0000000 --- a/tmux/.config/tmux/options.conf +++ /dev/null @@ -1,28 +0,0 @@ -# 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 - -# Enable hyperlinks -set-option -as terminal-features ",*:hyperlinks" diff --git a/tmux/.config/tmux/options.tmux b/tmux/.config/tmux/options.tmux new file mode 100644 index 0000000..ab6a97e --- /dev/null +++ b/tmux/.config/tmux/options.tmux @@ -0,0 +1,38 @@ +# 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 + +# Enable system clipboard integration (macOS) +set-option -g set-clipboard on + +# Allow focus events (for editors like Neovim) +set -g focus-events on + +# 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 + +# Enable hyperlinks +set-option -as terminal-features ",*:hyperlinks" + +# Enable true color support +set -ga terminal-overrides ",*256col*:Tc" +set -ga terminal-overrides ",tmux-256color:Tc" + +set -g default-terminal "tmux-256color" +set -g default-shell /bin/zsh diff --git a/tmux/.config/tmux/plugins.conf b/tmux/.config/tmux/plugins.conf deleted file mode 100644 index 58ca774..0000000 --- a/tmux/.config/tmux/plugins.conf +++ /dev/null @@ -1,27 +0,0 @@ -# Plugin manager -set-option -g @plugin 'tmux-plugins/tpm' - -# 'Sensible' set of defaults -set-option -g @plugin 'tmux-plugins/tmux-sensible' - -# Tmux FZF is a plugin that integrates FZF with tmux -TMUX_FZF_ORDER="session|window|pane|command|keybinding" -TMUX_FZF_OPTIONS="-p -w 90% -h 70% -m" -set-option -g @plugin 'sainnhe/tmux-fzf' - -# Resurrect is a plugin that saves and restores tmux sessions -set-option -g @plugin 'tmux-plugins/tmux-resurrect' -set-option -g @resurrect-save 'S' -set-option -g @resurrect-restore 'R' - -# Continuum is a plugin that automatically saves tmux sessions -# at regular intervals -set-option -g @plugin 'tmux-plugins/tmux-continuum' -set-option -g @continuum-restore 'on' -set-option -g @continuum-save-interval '15' -set-option -g @resurrect-strategy-nvim 'session' - -# Vim Tmux Navigator allows you to navigate between Vim and tmux panes -set-option -g @plugin 'christoomey/vim-tmux-navigator' - -run '~/.tmux/plugins/tpm/tpm' diff --git a/tmux/.config/tmux/plugins.tmux b/tmux/.config/tmux/plugins.tmux new file mode 100644 index 0000000..e5750e3 --- /dev/null +++ b/tmux/.config/tmux/plugins.tmux @@ -0,0 +1,45 @@ +# Plugin manager +set-environment -g TMUX_PLUGIN_MANAGER_PATH "$HOME/.config/tmux/plugins/" +set-option -g @plugin 'tmux-plugins/tpm' + +# 'Sensible' set of defaults +set-option -g @plugin 'tmux-plugins/tmux-sensible' + +# Tmux FZF is a plugin that integrates FZF with tmux +TMUX_FZF_ORDER="session|window|pane|command|keybinding" +TMUX_FZF_OPTIONS="-p -w 90% -h 70% -m" +set-option -g @plugin 'sainnhe/tmux-fzf' + +# Resurrect is a plugin that saves and restores tmux sessions +set-option -g @plugin 'tmux-plugins/tmux-resurrect' +set-option -g @resurrect-save 'S' +set-option -g @resurrect-restore 'R' + +# Continuum is a plugin that automatically saves tmux sessions +# at regular intervals +set-option -g @plugin 'tmux-plugins/tmux-continuum' +set-option -g @continuum-restore 'on' +set-option -g @continuum-save-interval '15' +set-option -g @resurrect-strategy-nvim 'session' + +# Vim Tmux Navigator allows you to navigate between Vim and tmux panes +set-option -g @plugin 'christoomey/vim-tmux-navigator' + +set-option -g @plugin 'tmux-plugins/tmux-yank' +set-option -g @plugin 'tmux-plugins/tmux-open' +set-option -g @plugin 'tmux-plugins/tmux-copycat' + +set-option -g @plugin "janoamaral/tokyo-night-tmux" +set -g @tokyo-night-tmux_theme night +set -g @tokyo-night-tmux_transparent 1 +set -g @tokyo-night-tmux_window_id_style digital +set -g @tokyo-night-tmux_pane_id_style hsquare +set -g @tokyo-night-tmux_zoom_id_style dsquare +set -g @tokyo-night-tmux_terminal_icon  +set -g @tokyo-night-tmux_active_terminal_icon  +set -g @tokyo-night-tmux_window_tidy_icons 1 +set -g @tokyo-night-tmux_show_datetime 1 +set -g @tokyo-night-tmux_date_format YMD +set -g @tokyo-night-tmux_time_format 24H + +run '$HOME/.config/tmux/plugins/tpm/tpm' diff --git a/tmux/.config/tmux/theme.conf b/tmux/.config/tmux/theme.conf deleted file mode 100644 index f0668ae..0000000 --- a/tmux/.config/tmux/theme.conf +++ /dev/null @@ -1,32 +0,0 @@ -# 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 4783498..4d2dbde 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -6,9 +6,9 @@ # https://github.com/tmux-plugins/tpm/issues/67#issuecomment-319561401 set-environment -g PATH "/usr/local/bin:/bin:/usr/bin" -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 +source-file ~/.config/tmux/key-remappings.tmux +source-file ~/.config/tmux/options.tmux +source-file ~/.config/tmux/vi.tmux +if-shell "uname | grep -q Darwin" "source-file ~/.config/tmux/macos.tmux" +source-file ~/.config/tmux/plugins.tmux diff --git a/tmux/.config/tmux/vi.conf b/tmux/.config/tmux/vi.conf deleted file mode 100644 index 6592f10..0000000 --- a/tmux/.config/tmux/vi.conf +++ /dev/null @@ -1,8 +0,0 @@ -# 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 - diff --git a/tmux/.config/tmux/vi.tmux b/tmux/.config/tmux/vi.tmux new file mode 100644 index 0000000..85f2f37 --- /dev/null +++ b/tmux/.config/tmux/vi.tmux @@ -0,0 +1,6 @@ +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 diff --git a/tmux/.tmux/plugins/tpm b/tmux/.tmux/plugins/tpm deleted file mode 160000 index 99469c4..0000000 --- a/tmux/.tmux/plugins/tpm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 -- cgit v1.2.3