Skip to content

Instantly share code, notes, and snippets.

@litew
Last active November 9, 2023 23:38
Show Gist options
  • Save litew/a2736ec94375d6e90c87b3c22456a074 to your computer and use it in GitHub Desktop.
Save litew/a2736ec94375d6e90c87b3c22456a074 to your computer and use it in GitHub Desktop.
my tmux config
unbind C-b
set-option -g prefix "`"
bind-key "`" send-prefix
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Enable mouse scrolling.
set -g mouse on
## {n}vim compability
#set-option -ga terminal-overrides ",xterm-256color:Tc"
bind-key r source-file ~/.tmux.conf
set-option -g default-shell /bin/zsh
set-option -g default-terminal "tmux-256color"
set -ag terminal-overrides ",$TERM:RGB"
# Fix ctrl+left/right keys work right
set-window-option -g xterm-keys on
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Move panes with Alt+Arrows
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
# switch windows alt+number
#bind-key -n Super_L-1 select-window -t 1
#bind-key -n Super_L-2 select-window -t 2
#bind-key -n Super_L-3 select-window -t 3
#bind-key -n Super_L-4 select-window -t 4
#bind-key -n Super_L-5 select-window -t 5
#bind-key -n Super_L-6 select-window -t 6
#bind-key -n Super_L-7 select-window -t 7
#bind-key -n Super_L-8 select-window -t 8
#bind-key -n Super_L-9 select-window -t 9
# Set pane split commands
unbind '"'
unbind %
bind '\' split-window -h
bind '-' split-window -v
# Enable mouse control (clickable windows, panes, resizable panes)
#set -g mouse-select-window on
#set -g mouse-select-pane on
#set -g mouse-resize-pane on
# Enable activity status
setw -g monitor-activity on
set -g visual-activity on
# Set color for active window
#set -g window-status-current-style bg=yellow
# THEME
set -g status-bg black
set -g status-fg white
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green]#S '
set -g status-right '#[fg=yellow]#(cut -d " " -f 1 /proc/loadavg)#[default] #[fg=white]%H:%M %Z, %d.%m.%Y#[default]'
setw -g window-status-separator ''
setw -g window-status-current-style bg=blue,fg=black
set-window-option -g window-status-current-format "\
#[fg=black, bg=colour33] #I \
#[fg=black, bg=colour35] #W \
#[fg=black, bg=colour2]"
## other windows and panes indices at bottom left corner
set-window-option -g window-status-format "\
#[fg=black, bg=colour117] #I \
#[fg=black, bg=colour4] #W \
#[fg=black, bg=colour4]"
# List of 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-resurrect'
set -g @plugin 'tmux-plugins/tmux-copycat'
#set -g @plugin 'tmux-plugins/tmux-logging'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
#setenv -g logging-path "$HOME/Documents/tmuxlogs"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# Activate tmux-resurrect plugin (~/.tmux/plugins/resurrect is a clone of
# https://github.com/tmux-plugins/tmux-resurrect).
#run-shell ~/.tmux/plugins/resurrect/resurrect.tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment