Skip to content

Instantly share code, notes, and snippets.

@wwwins
Created March 4, 2025 07:03
Show Gist options
  • Save wwwins/33f155ec2eb43a91bb4a25f76ea407ee to your computer and use it in GitHub Desktop.
Save wwwins/33f155ec2eb43a91bb4a25f76ea407ee to your computer and use it in GitHub Desktop.
tmux config file
# remap C-b to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# split panes using \ and - in current path
bind '\' split-window -hc "#{pane_current_path}"
bind - split-window -vc "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
unbind %
unbind '"'
# switch pane use vi keys
bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
bind l select-pane -R
unbind Up
unbind Down
unbind Left
unbind Right
# reload config file
bind-key r source-file ~/.tmux.conf \; display-message "Reloaded ~/.tmux.conf"
# setup tmux to 256 colors
set-option -ga terminal-overrides ",screen-256color:Tc"
# use vi keys
set -gw mode-keys vi
# enable mouse
set -g mouse on
setw -g mode-keys vi
# use 'v' to begin selection in copy mode, similar entering visual mode in Vim
bind -T copy-mode-vi v send-keys -X begin-selection
# use 'y' to yank selected text to system clipboard in copy mode, similar to yanking
# from visual selection in Vim
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# copy by mouse selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Repeat time limit (ms)
#set-option -g repeat-time 500
set-option -g repeat-time 0
# history
set-option -g history-limit 10000
# status color
set -g status-style "fg=black,bg=colour110"
set -g status-right '#[fg=colour22,bold]#(uptime | rev | cut -d":" -f1 | rev | sed s/,//g) #[fg=colour249,bg=colour241] %H:%M%h/%d/%y '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment