Skip to content

Instantly share code, notes, and snippets.

@oscargicast
Created November 17, 2014 18:14
Show Gist options
  • Save oscargicast/8c1c1b202cd577f77e84 to your computer and use it in GitHub Desktop.
Save oscargicast/8c1c1b202cd577f77e84 to your computer and use it in GitHub Desktop.
tmux
# List of plugins
# Supports `github_username/repo` or full git URLs
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-online-status \
tmux-plugins/tmux-battery \
'
source "/usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf"
# tmux-online-status
#set -g status-right "#[fg=cyan]»#(echo $USER) #[default]Online:#{online_status}#[fg=blue,bold]Batt:#{battery_icon}#{battery_percentage} #[fg=magenta]%d%h %H:%M#[default]"
#set -g status-interval 5
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# color
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour252
set-window-option -g window-status-bg default
# active window title colors
set-window-option -g window-status-current-fg colour212 #orange
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# color
setw -g xterm-keys on
set -g default-terminal "screen-256color"
# status bar
set-option -g status-utf8 on
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+
# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Restoring Clear Screen (C-l)
#bind C-l send-keys 'C-l'
bind -n C-b send-keys 'C-l'
# set window split
bind-key v split-window -h
bind-key s split-window
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# Vi copypaste mode
set-window-option -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# scrollback size
set -g history-limit 10000
###########################################################################
# Mouse mode
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# Toggle mouse on
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# scrollback size
set -g history-limit 10000
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell ~/.tmux/plugins/tpm/tpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment