Skip to content

Instantly share code, notes, and snippets.

@kingluddite
Created August 22, 2021 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingluddite/f406346a3492aa7c8a30d19e67326933 to your computer and use it in GitHub Desktop.
Save kingluddite/f406346a3492aa7c8a30d19e67326933 to your computer and use it in GitHub Desktop.
# Settin: the prefix from Ctrl-b to Ctrl-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
# setting the delay between the prefix and command:
set -s escape-time 1
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
set -g pane-base-index 1
# Reload the file with Prefix r and show "Reloaded!" in display
bind r source-file ~/.tmux.conf \; display "Reloaded Phil!";
# Ensure that we can send Ctrl-a to other apps
# You can send Ctrl-a to an app running within tmux by
# Pressing Ctrl-a twice
bind C-a send-prefix
## PANES ##
# splitting panes with | and =
bind | split-window -h
bind - split-window -v
# moving between paens with Prefix h,j,k,l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# quick window selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# resizing panes with Prefix H,J,K,L
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# mouse control (clickable windows, panes, resizable panes)
# set to on if you want to use the mouse
set -g mouse off
# set the default terminal mode to 256color mode
# I turned this off and used the xterm below (looks better)
# set -g default-terminal "screen-256color"
# fix issue with incorrect Vim colors
# tmux healthcheck instructed me to add this line
# WARNING given - $TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.
set -g default-terminal "tmux-256color"
set-option -sa terminal-overrides ",xterm-256color:RGB"
# set the status line's colors
set -g status-style fg=white,bold,bg=black
# set the color of the window list
setw -g window-status-style fg=cyan,bg=black
# set colors for the active window
setw -g window-status-current-style fg=white,bold,bg=red
# colors for pane borders
setw -g pane-border-style fg=green,bg=black
setw -g pane-active-border-style fg=white,bg=yellow
# active pane normal, others shaded out
setw -g window-style fg=colour240,bg=colour235
setw -g window-active-style fg=white,bg=black
# Command / message line
set -g message-style fg=white,bg=black
# status line left side to show Session:window:pane
set -g status-left-length 42
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
# status line right side - 31-Oct 13:37
set -g status-right "#[fg=cyan]%d %b %R"
# update the status line every sixty seconds
set -g status-interval 60
# center the window list in the status line
set -g status-justify centre
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# don't rename windows automatically
set -g allow-rename off
# enable vi mode keys
# by default arrow keys are used to navigate in terminal
# but with this setting we can use h, j, k, l to move around buffer
setw -g mode-keys vi
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# If you kill tmux server or shut down your computer tmux sessions come back to life
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
# 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