Skip to content

Instantly share code, notes, and snippets.

@ravshansbox
Created June 22, 2026 05:46
Show Gist options
  • Select an option

  • Save ravshansbox/bdb1b3bf2b4ce2ec9ee539849b7320bf to your computer and use it in GitHub Desktop.

Select an option

Save ravshansbox/bdb1b3bf2b4ce2ec9ee539849b7320bf to your computer and use it in GitHub Desktop.
# ─── Key bindings ───────────────────────────────────────────────────────────
# Open new windows/panes in the same directory as the current pane,
# instead of tmux's default of starting in your home directory.
bind c new-window -c "#{pane_current_path}"
# Split bindings that also keep the current pane's directory.
# prefix + " -> split vertically (top/bottom)
# prefix + % -> split horizontally (left/right)
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# prefix + r -> reload this config without restarting tmux, with a confirmation message.
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded!"
# Ctrl-k (no prefix needed) -> clear the screen AND wipe the scrollback history,
# so you get a truly clean terminal.
bind -n C-k send-keys C-l \; send-keys -R \; clear-history
# ─── Shell / general behavior ───────────────────────────────────────────────
# Refresh the status bar every second (needed for the live clock below).
set -g status-interval 1
# Enable extended key reporting (CSI u), so modifier combos like Ctrl-/, Ctrl-Enter,
# etc. are passed through to apps (e.g. editors) instead of being swallowed.
set -g extended-keys on
set -g extended-keys-format csi-u
# Automatically renumber windows so there are no gaps after closing one.
set -g renumber-windows on
# Start window and pane numbering at 1 instead of 0 (easier to reach on the keyboard).
set -g base-index 1
setw -g pane-base-index 1
# Enable mouse support: click to select panes/windows, drag borders to resize, scroll to scrollback.
set -g mouse on
# ─── Status bar appearance ──────────────────────────────────────────────────
# Show a live date and time on the right side of the status bar.
set -g status-right '%Y-%m-%d %H:%M:%S'
# Colors for copy/selection mode highlighting (white text on dark green).
set -g mode-style "fg=colour255,bg=colour22"
# Status bar colors: white text on a dark green background.
set -g status-fg colour255
set -g status-bg colour22
# Style for messages/prompts shown by tmux (white text on red).
set -g message-style fg=colour255,bg=colour1
# Highlight the currently active window with a brighter green background.
setw -g window-status-current-style bg=colour28
# Window labels: show the window index plus just the last folder name of the
# pane's current path instead of the full process/path.
set -g window-status-current-format ' #I:#{b:pane_current_path} '
set -g window-status-format ' #I:#{b:pane_current_path} '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment