Skip to content

Instantly share code, notes, and snippets.

@evaldosantos
Created December 14, 2018 10:58
Show Gist options
  • Save evaldosantos/aaf6b11c46e1efd1a711c1a0d06cee1b to your computer and use it in GitHub Desktop.
Save evaldosantos/aaf6b11c46e1efd1a711c1a0d06cee1b to your computer and use it in GitHub Desktop.
###########################
### Configuration
############################
#
# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# Retach userspaces
#set -g default-command "reattach-to-user-namespace -l zsh"
# increase scroll-back history
# set -g history-limit 5000
# use vim key bindings
setw -g mode-keys vi
# increase repeat time for repeatable commands
set -g repeat-time 1000
# So this option has been renamed in version 2.1 (18 October 2015)
# http://stackoverflow.com/questions/11832199/tmux-set-g-mouse-mode-on-doesnt-work
set -g mouse on
# https://www.reddit.com/r/tmux/comments/3paqoi/tmux_21_has_been_released/
# bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
# bind-key -t vi-copy PPage page-up
# bind-key -t vi-copy NPage page-down
# UTF is great, let us use that
# set -g utf8
# set-window-option -g utf8 on
# decrease command delay (increases vim responsiveness)
# set -sg escape-time 1
# Set the numbering of windows to go from 1 instead of 0 - silly programmers :|
set-option -g base-index 1
set-window-option -g pane-base-index 1
setw -g pane-base-index 1
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
# Basically allows for faster key repetition
set -s escape-time 0
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*.
setw -g aggressive-resize on
###########################
## Key Bindings
############################
# Clear history with Command and Key
# http://stackoverflow.com/questions/10543684/how-can-i-clear-scrollback-buffer-in-tmux
# act like GNU screen
# unbind C-b
# set -g prefix `
# bind ` send-prefix
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Open last window
# bind-key L last-window
# Allow us to reload our Tmux configuration while using Tmux
# bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Getting interesting now, we use the vertical and horizontal
# symbols to split the screen
# bind | split-window -h
# bind - split-window -v
###########################
## tmux Copy & Paste
############################
#
# https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future
# Use vim keybindings in copy mode
setw -g mode-keys vi
# 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"
###########################
## Colors
############################
# color status bar
set -g status-bg colour235
set -g status-fg white
# highlight current window
set-window-option -g window-status-current-fg black
set-window-option -g window-status-current-bg green
# set color of active pane
set -g pane-border-fg colour235
set -g pane-border-bg black
set -g pane-active-border-fg green
set -g pane-active-border-bg black
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment