Skip to content

Instantly share code, notes, and snippets.

@henrytseng
Last active September 27, 2019 14:19
Show Gist options
  • Save henrytseng/1918c6b57d1da5440f905038cf7b61f4 to your computer and use it in GitHub Desktop.
Save henrytseng/1918c6b57d1da5440f905038cf7b61f4 to your computer and use it in GitHub Desktop.
.tmux.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g default-terminal "screen-256color"
#set -ga terminal-overrides ",screen-256color:Tc"
# statusbar
# set -g status-style 'bg=colour235 fg=colour136'
# set -g status-left ''
# set -g status-right '#[fg=colour136,bg=colour235] %H:%M:%S '
# setw -g window-status-current-style 'fg=colour1 bg=colour240 bold'
# setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '
# setw -g window-status-style 'fg=colour118 bg=colour236'
# setw -g window-status-format ' #I#[fg=colour249]:#[fg=colour250]#W#[fg=colour244]#F '
# Switch windows
# usage: "SHIFT+arrow" (without prefix key)
bind -n S-Left previous-window
bind -n S-Right next-window
set -g mouse on
# to enable mouse scroll, see https://github.com/tmux/tmux/issues/145#issuecomment-150736967
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# Copy pasta
# set -g mouse on lets you use the mouse to select after going into copy mode
# otherwise can use usual vi bindings
setw -g mode-keys vi
bind P paste-buffer # adds P as a replacement for ]
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel pbcopy
run -b '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment