From 00081485c19f8e91dbda921ff1358fe94f54b183 Mon Sep 17 00:00:00 2001 From: joshuayuen99 Date: Sat, 4 Nov 2023 01:13:10 -0400 Subject: [PATCH] Add tmux config --- private_dot_config/tmux/tmux.conf | 89 +++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 private_dot_config/tmux/tmux.conf diff --git a/private_dot_config/tmux/tmux.conf b/private_dot_config/tmux/tmux.conf new file mode 100644 index 0000000..b279505 --- /dev/null +++ b/private_dot_config/tmux/tmux.conf @@ -0,0 +1,89 @@ +# Change prefix +unbind C-b +set -g prefix C-space + +# Allow mouse clicking +set -g mouse on + +# Start with window 1 (instead of 0) +set -g base-index 1 + +# Start with pane 1 +set -g pane-base-index 1 + +# Use alt + arrow keys without prefix to switch panes +bind -n M-h select-pane -L +bind -n M-l select-pane -R +bind -n M-k select-pane -U +bind -n M-j select-pane -D + +# Shift + arrow keys to switch windows +bind -n S-Left previous-window +bind -n S-Right next-window + +# Splits open in the same working directory +bind '%' split-window -h -c '#{pane_current_path}' +bind '"' split-window -c '#{pane_current_path}' + +# Reload tmux.conf +bind 'r' source ~/.config/tmux/tmux.conf \; display-message ' Reloaded .config/tmux/tmux.conf' + +# Plugin support +# tmux-prefix-highlight +set -g @prefix_highlight_bg brightcyan +set -g @prefix_highlight_fg black +set -g @prefix_highlight_output_prefix '#[fg=brightcyan]#[bg=black]#[nobold]#[noitalics]#[nounderscore]#[bg=brightcyan]#[fg=black]' +set -g @prefix_highlight_output_suffix '' +set -g @prefix_highlight_copy_mode_attr 'fg=brightcyan,bg=black,bold' +# Status +set -g status-position bottom +set -g status-justify left +set -g status-style bg=black,fg=white +set -g status-interval 1 +set -g status on +set -g status-left-length 20 +set -g status-right-length 50 +# Statusbar +set -g status-left '#[fg=black,bg=blue,bold] #S #[fg=blue,bg=black,nobold,noitalics,nounderscore]' +set -g status-right '#{prefix_highlight}#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %a %m/%d #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %l:%M:%S %p #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore]#[fg=black,bg=cyan,bold] #H' + +# Windows +set -g window-status-format '#[fg=black,bg=brightblack,nobold,noitalics,nounderscore] #[fg=white,bg=brightblack]#I #[fg=white,bg=brightblack,nobold,noitalics,nounderscore] #[fg=white,bg=brightblack]#W #F #[fg=brightblack,bg=black,nobold,noitalics,nounderscore]' +set -g window-status-current-format '#[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#I #[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#W #F #[fg=cyan,bg=black,nobold,noitalics,nounderscore]' +set -g window-status-separator '' + +# Panes +set -g pane-border-style bg=default,fg=brightblack +set -g pane-active-border-style bg=default,fg=blue +set -g display-panes-colour black +set -g display-panes-active-colour brightblack + +# Clock +setw -g clock-mode-colour cyan + +# Messages +set -g message-style bg=brightblack,fg=cyan +set -g message-command-style bg=brightblack,fg=cyan + +# Fix colors +set-option -as terminal-overrides ",xterm*:Tc" + +# Plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' + +# Set vi-mode +set-window-option -g mode-keys vi +# Copy-paste keybindings +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 + +# Automatically install tpm if needed +if "test ! -d ~/.tmux/plugins/tpm" \ + "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" + +# Initialize TMUX plugin manager +run '~/.tmux/plugins/tpm/tpm'