Skip to content

Instantly share code, notes, and snippets.

@bpceee
Created February 26, 2018 03:21
Show Gist options
  • Save bpceee/de57a1ca62b7123d5ce2a9192af8716b to your computer and use it in GitHub Desktop.
Save bpceee/de57a1ca62b7123d5ce2a9192af8716b to your computer and use it in GitHub Desktop.
.tmux.conf
set -g default-terminal "screen-256color"
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
#Force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# Use vim keybindings in copy mode
setw -g mode-keys vi
# setup: brew install reattach-to-user-namespace
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace 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-cancel "reattach-to-user-namespace pbcopy"
# Bind ']' to use pbbaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
set-option -g mouse on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment