From 8a84aa08379fcc3616bdc6604a4ad9df2bcba5f1 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 3 Sep 2023 21:36:50 +1000 Subject: [PATCH] Added tmux config --- .config/tmux/tmux.conf | 60 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .config/tmux/tmux.conf diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..2a87d3c --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,60 @@ +# Use Ctrl a as the control key +set-option -g prefix C-a +unbind C-a +bind C-a send-prefix + +# Enable mouse support +set-option -g mouse on + +# Set vi mode for easier navigation +set-window-option -g mode-keys vi + +# Allow vim-like copy mode +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel +bind-key -T copy-mode-vi r send-keys -X rectangle-toggle + +# Use the same key binding for both copy mode and paste buffer +bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" +bind C-a paste-buffer + +# Enable larger scrollback buffer +set-option -g history-limit 10000 + +# Splitting panes with Ctrl a + % (vertical) and Ctrl a + " (horizontal) +bind '"' split-window -h +bind % split-window -v + +# Set status bar +set-option -g status on +set-option -g status-position "bottom" +set-option -g status-interval 5 +set-option -g status-justify "left" +set-option -g status-left-length 5 +set-option -g status-left "#[fg=orange]#S " +set-option -g status-right " #[fg=green]%H:%M %d-%b-%y" +set-option -g status-right-length 30 +set-option -g status-style "bg=default,fg=green" +#set-option -g status-style bg=colour235,fg=default +# Change window options +set-window-option -g window-style 'fg=default,bg=default' +set-window-option -g window-active-style 'fg=default,bg=default' +set-window-option -g window-status-separator ' ' +set-window-option -g window-status-current-style 'bg=default bold' +set-window-option -g window-status-last-style 'bg=default' + +# Reorder window indexes with CTRL+SHIFT+Left/Right +bind-key -n C-S-Left swap-window -t -1\; select-window -t -1 +bind-key -n C-S-Right swap-window -t +1\; select-window -t +1 + +# Bind a key to synchronize input to all panes +bind-key C-s setw synchronize-panes + +# Reload config without detaching the session +bind R source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded!" + +# Automatic window renaming +set-window-option -g automatic-rename on + +# Start with window index 1 +set-option -g base-index 1