Skip to content

Instantly share code, notes, and snippets.

@dome
Created November 2, 2016 13:51
Show Gist options
  • Save dome/dd21d75721ecbcc14fa7fc9b3d62b8d0 to your computer and use it in GitHub Desktop.
Save dome/dd21d75721ecbcc14fa7fc9b3d62b8d0 to your computer and use it in GitHub Desktop.
set -g default-terminal "screen-256color"
set-option -g default-shell $SHELL
# Set the Bind Key
#unbind C-b
#set -g prefix `
#bind-key ` send-prefix
#bind-key L last-window
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# Window title string (uses statusbar variables)
set -g set-titles-string '#T'
#set -g set-titles-string '#(pwd)'
set-window-option -g automatic-rename off
set-window-option -g xterm-keys on
# Scroll History
set -g history-limit 150000
# start window numbering at 1 for easier switching
set -g base-index 1
# 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*. Much more reasonable.
setw -g aggressive-resize on
# Pane border colors
set -g pane-border-bg colour235
set -g pane-border-fg colour238
set -g pane-active-border-bg colour236
set -g pane-active-border-fg colour51
# Easy bindings for split
unbind %
unbind '"'
bind / split-window -h
bind - split-window -v
# === Evil-Emacs->Tmux->Navigator ===
# vim movement bindings
set-option -g status-keys vi
setw -g mode-keys vi
# pane/window movement bindings to work with evil-emacs-navigator mode
#bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-h) || tmux select-pane -L"
#bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-j) || tmux select-pane -D"
#bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-k) || tmux select-pane -U"
#bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-l) || tmux select-pane -R"
# for terminal vim escaping
set -s escape-time 0
# enable mouse mode (and scrolling)
set -g mouse on
# Fix from: https://github.com/tmux/tmux/issues/145
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# listen to alerts from all windows
set -g bell-action any
# === Status Bar ===
#set -g utf8 on
#set -g status-utf8 on
#set-window-option -g utf8 on
set-option -g status-position bottom
set -g status-interval 10
set -g status-justify right
set -g status-left-length 80
set -g status-right-length 90
setw -g window-status-current-format "#[bg=white][#[fg=yellow] #I: #[fg=black]#W #[fg=white]]"
setw -g window-status-format "[#[fg=yellow] #I: #[fg=white]#W #[fg=white]]"
setw -g status-left ' #[fg=cyan,bright]#S#[fg=white]/#[fg=cyan,bright]#P #[fg=white]| #[fg=yellow]#T #[fg=white]|'
setw -g status-right '#[bg=black,fg=white,bright] >> [%a %Y-%m-%d %H:%M]'
# === OS X pasteboard support ===
#set-option -g default-command "reattach-to-user-namespace -l zsh"
# http://www.drbunsen.org/the-text-triumvirate/
unbind [
bind [ copy-mode
#unbind p
#bind p paste-buffer
unbind -t vi-copy Enter
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
bind -t vi-copy Escape cancel
# from: https://github.com/tmux-plugins/tmux-resurrect
#run-shell ~/.config/tmux-resurrect/resurrect.tmux
set -g default-terminal "screen-256color"
set-option -g default-shell $SHELL
# Set the Bind Key
unbind C-b
#set -g prefix `
#bind-key ` send-prefix
set-option -g prefix C-a
bind-key L last-window
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# Window title string (uses statusbar variables)
set -g set-titles-string '#T'
#set -g set-titles-string '#(pwd)'
set-window-option -g automatic-rename off
set-window-option -g xterm-keys on
# Scroll History
set -g history-limit 150000
# start window numbering at 1 for easier switching
set -g base-index 1
# 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*. Much more reasonable.
#setw -g aggressive-resize off
set-window-option -g aggressive-resize off
# Pane border colors
set -g pane-border-bg colour235
set -g pane-border-fg colour238
set -g pane-active-border-bg colour236
set -g pane-active-border-fg colour51
# Easy bindings for split
#unbind %
#unbind '"'
#bind / split-window -h
#bind - split-window -v
# === Evil-Emacs->Tmux->Navigator ===
# vim movement bindings
set-option -g status-keys vi
setw -g mode-keys vi
# pane/window movement bindings to work with evil-emacs-navigator mode
#bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-h) || tmux select-pane -L"
#bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-j) || tmux select-pane -D"
#bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-k) || tmux select-pane -U"
#bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-l) || tmux select-pane -R"
# for terminal vim escaping
set -s escape-time 0
# enable mouse mode (and scrolling)
set -g mouse on
# Fix from: https://github.com/tmux/tmux/issues/145
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# listen to alerts from all windows
set -g bell-action any
# === Status Bar ===
#set -g utf8 on
#set -g status-utf8 on
#set-window-option -g utf8 on
set-option -g status-position bottom
set -g status-interval 10
set -g status-justify right
set -g status-left-length 80
set -g status-right-length 90
setw -g window-status-current-format "#[bg=white][#[fg=yellow] #I: #[fg=black]#W #[fg=white]]"
setw -g window-status-format "[#[fg=yellow] #I: #[fg=white]#W #[fg=white]]"
setw -g status-left ' #[fg=cyan,bright]#S#[fg=white]/#[fg=cyan,bright]#P #[fg=white]| #[fg=yellow]#T #[fg=white]|'
setw -g status-right '#[bg=black,fg=white,bright] >> [%a %Y-%m-%d %H:%M]'
# === OS X pasteboard support ===
#set-option -g default-command "reattach-to-user-namespace -l zsh"
# http://www.drbunsen.org/the-text-triumvirate/
unbind [
bind [ copy-mode
#unbind p
#bind p paste-buffer
unbind -t vi-copy Enter
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
bind -t vi-copy Escape cancel
# from: https://github.com/tmux-plugins/tmux-resurrect
#run-shell ~/.config/tmux-resurrect/resurrect.tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment