Skip to content

Instantly share code, notes, and snippets.

@ashpreetbedi
Created December 29, 2024 12:53
Show Gist options
  • Save ashpreetbedi/9880956e6b69a95f5d91551d34ddbbe0 to your computer and use it in GitHub Desktop.
Save ashpreetbedi/9880956e6b69a95f5d91551d34ddbbe0 to your computer and use it in GitHub Desktop.
# Copying these from: http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# split panes using | and -
bind d split-window -h
bind - split-window -v
unbind '"'
unbind %
set -g base-index 1
setw -g pane-base-index 1
# reload config file using r
bind r source-file ~/.tmux.conf \; display "Config reloaded"
# switch panes using Alt-arrow without prefix
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
# Zoom pane
bind + resize-pane -Z
# Ctrl+Shift+Left will move the current window to the left
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
# Ctrl+Shift+Right will move the current window to the right
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
# Select pane and windows
bind -r C-[ previous-window
bind -r C-] next-window
bind -r Tab last-window # cycle thru MRU tab
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# bind -t vi-copy WheelUpPane scroll-up
# bind -t vi-copy WheelDownPane scroll-down
# don't rename windows automatically
set-option -g allow-rename off
# ask for new name for window
set-hook -g after-new-window 'command-prompt -I "#{window_name}" "rename-window '%%'"'
# Kill pane/window/session shortcuts
bind x kill-pane
bind X kill-window
bind C-x confirm-before -p "kill other windows? (y/n)" "kill-window -a"
bind Q confirm-before -p "kill-session #S? (y/n)" kill-session
# clear the screen in tmux
bind k send-keys -R \; send-keys C-l \; clear-history
# bind w to detach just like cmd-w to close tab in iterm
bind w detach
######################
### DESIGN CHANGES ###
######################
# statusbar
set -g status-style 'bg=colour77 fg=colour233'
set -g status-left ''
set -g status-right '#[fg=colour4,bg=colour18] %H:%M %p '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment