Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My tmux config
## Better colors
set -g default-terminal "screen-256color"
## Fix the clipboard access (`brew install reattach-to-user-namespace`)
set-option -g default-command "reattach-to-user-namespace -l bash"
# Use vim keybindings in copy mode
setw -g mode-keys vi
## Change prefix
unbind C-b
set -g prefix `
bind-key ` send-prefix
## Remap splitting a window to open in selected pane's cwd
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
## Fix wait time for escape (helps with tmux and vim)
set -s escape-time 0
## Fix issues with yank/paste from buffer to system
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
## Mouse integration
set-option -g -q mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
## Resize panes quickly
# alt + arrow key to resize pane
bind-key -r 'M-Left' resize-pane -L 20
bind-key -r 'M-Right' resize-pane -R 20
bind-key -r 'M-Up' resize-pane -U 20
bind-key -r 'M-Down' resize-pane -D 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.