Skip to content

Instantly share code, notes, and snippets.

@prime-hacker
Last active February 12, 2023 21:30
Show Gist options
  • Save prime-hacker/0b86b4a4b68ad6df6eada057b43deb46 to your computer and use it in GitHub Desktop.
Save prime-hacker/0b86b4a4b68ad6df6eada057b43deb46 to your computer and use it in GitHub Desktop.
# NEEDED FOR THIS TO RUN PROPERLY:
# 1. INSTALL XCLIP
# 2. TMUX Plugin Manager (https://github.com/tmux-plugins/tpm)
# 3. Type (your prefex + I) to install the plugins
set-option -g prefix C-a
#Command Sequence for Nested Tmux Sessions
bind-key a send-prefix
# Set the base index for windows to 1 instead of 0
set -g base-index 1
set -g default-terminal "screen-256color"
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Set the base index for panes to 1 instead of 0
set -g pane-base-index 1
#setting the delay between prefix and command
set -s escape-time 5
# Set bind key to reload configuration file
bind r source-file ~/.tmux.conf \; display ​"Reloaded!"
# splitting panes with | and -
bind | split-window -h
bind - split-window -v
# Enable mouse support
set -g mouse on
# Pane Navigation
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
setw -g mode-key vi
set-option -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
##For linux
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i' \; display-message "Copied to Clipboard"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i' \; display-message "Copied to Clipboard"
##For Windows
#bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'clip.exe' \; display-message "Copied to Clipboard"
#bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'clip.exe' \; display-message "Copied to Clipboard"
## THEME
#set inactive/active window styles
set -g window-style 'fg=colour250,bg=colour236'
set -g window-active-style 'fg=colour255,bg=black'
# pane border
set -g pane-border-style fg='#6272a4'
set -g pane-active-border-style fg='#ff79c6'
# message text
set -g message-style bg='#44475a',fg='#8be9fd'
# status bar theme
set -g status-style bg='#44475a',fg='#bd93f9'
set -g status-interval 1
# status left
# are we controlling tmux or the content of the panes?
set -g status-left '#[bg=#f8f8f2]#[fg=#282a36]#{?client_prefix,#[bg=#ff79c6],} ☺ '
# are we zoomed into a pane?
set -ga status-left '#[bg=#44475a]#[fg=#ff79c6] #{?window_zoomed_flag, ↕ , }'
# window status
set-window-option -g window-status-style fg='#bd93f9',bg=default
set-window-option -g window-status-current-style fg='#ff79c6',bg='#282a36'
set -g window-status-current-format "#[fg=#44475a]#[bg=#bd93f9]#[fg=#f8f8f2]#[bg=#bd93f9] #I #W #[fg=#bd93f9]#[bg=#44475a]"
set -g window-status-format "#[fg=#f8f8f2]#[bg=#44475a]#I #W #[fg=#44475a] "
# status right
set -g status-right '#[fg=#8be9fd,bg=#44475a]#[fg=#44475a,bg=#8be9fd] #(tmux-mem-cpu-load -g 5 --interval 2) '
set -ga status-right '#[fg=#ff79c6,bg=#8be9fd]#[fg=#44475a,bg=#ff79c6] #(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") '
set -ga status-right '#[fg=#bd93f9,bg=#ff79c6]#[fg=#f8f8f2,bg=#bd93f9] %a %H:%M:%S #[fg=#6272a4]%Y-%m-%d '
# To install TMUX Plugin Manager
# Visit this link: https://github.com/tmux-plugins/tpm
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment