Skip to content

Instantly share code, notes, and snippets.

@phacks
Last active February 6, 2017 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phacks/d06ee1f516cf73d7a3f5 to your computer and use it in GitHub Desktop.
Save phacks/d06ee1f516cf73d7a3f5 to your computer and use it in GitHub Desktop.
tmux.conf
# Set reload key to r
bind r source-file ~/.tmux.conf
# use UTF8
set -g utf8
set-window-option -g utf8 on
# set Ctrl-a as the default prefix key combination and unbind C-b to free it up
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Set italics compliant terminfo
set -g default-terminal "xterm-256color-italic"
# Set colors
set-option -g default-terminal "xterm-256color-italic"
# Count sessions start at 1
set -g base-index 1
set -g pane-base-index 1
# Use vim bindings
setw -g mode-keys vi
# Remap window navigation to vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
# Prefix + q quits a window
bind q killp
# Set status bar
set -g status-bg "colour18"
set -g message-command-fg "colour7"
set -g status-justify "centre"
set -g status-left-length "100"
set -g status "on"
set -g pane-active-border-fg "colour4"
set -g message-bg "colour19"
set -g status-right-length "100"
set -g status-right-attr "none"
set -g message-fg "colour7"
set -g message-command-bg "colour19"
set -g status-attr "none"
set -g status-utf8 "on"
set -g pane-border-fg "colour19"
set -g status-left-attr "none"
setw -g window-status-fg "colour7"
setw -g window-status-attr "none"
setw -g window-status-activity-bg "colour18"
setw -g window-status-activity-attr "none"
setw -g window-status-activity-fg "colour4"
setw -g window-status-separator ""
setw -g window-status-bg "colour18"
set -g status-left "#[fg=colour18,bg=colour4,bold] #S #[fg=colour4,bg=colour19,nobold,nounderscore,noitalics]#[fg=colour7,bg=colour19] #F #[fg=colour19,bg=co
lour18,nobold,nounderscore,noitalics]#[fg=colour7,bg=colour18] #W #[fg=colour18,bg=colour18,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour18,bg=colour18,nobold,nounderscore,noitalics]#[fg=colour7,bg=colour18] %a #[fg=colour19,bg=colour18,nobold,nounderscore,noita
lics]#[fg=colour7,bg=colour19] %b %d  %R #[fg=colour4,bg=colour19,nobold,nounderscore,noitalics]#[fg=colour18,bg=colour4] #H "
setw -g window-status-format "#[fg=colour18,bg=colour18,nobold,nounderscore,noitalics]#[default] #I  #W #[fg=colour18,bg=colour18,nobold,nounderscore,noital
ics]"
setw -g window-status-current-format "#[fg=colour18,bg=colour19,nobold,nounderscore,noitalics]#[fg=colour7,bg=colour19] #I  #W #[fg=colour19,bg=colour18,nob
old,nounderscore,noitalics]"
# 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"
# List of plugins
# Supports `github_username/repo` or full git URLs
set -g @tpm_plugins " \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-pain-control \
tmux-plugins/tmux-battery \
"
# Other examples:
# github_username/plugin_name \
# git@github.com/user/plugin \
# git@bitbucket.com/user/plugin \
# 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