Skip to content

Instantly share code, notes, and snippets.

@elipapa
Forked from subfuzion/.tmux.conf
Last active May 15, 2017 21:26
Show Gist options
  • Save elipapa/8410f4689d57aba17c8aeff602ee241d to your computer and use it in GitHub Desktop.
Save elipapa/8410f4689d57aba17c8aeff602ee241d to your computer and use it in GitHub Desktop.
My .tmux.conf for tmux 2.1 (with fixes for mouse breakage)
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
#
set -g default-terminal "screen-256color"
# ***WARNING!*** tmux will exit immediately if this plugin is not installed!!!
# http://superuser.com/questions/397076/tmux-exits-with-exited-on-mac-os-x
# set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# reload ~/.tmux.conf using prefix r
bind r source-file ~/.tmux.conf \; display "tmux reloaded"
# change split prefixes (horizontal: C-b /) (vertical: C-b -)
bind / split-window -h
bind - split-window -v
# set scrollback history to 10K lines
set -g history-limit 10000
# mouse support
#setw -g mode-mouse on
set -g mouse on
# https://github.com/tmux/tmux/issues/145#issuecomment-151098708
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
# vi
====
#setw -g mode-keys vi
#set -g status-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 (os x)
#unbind -t vi-copy Enter
#bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# map vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# use vi left and right to cycle thru panes
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# resize panes using vi keys
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# status bar
# ==========
# set status bar
#set -g status-justify centre
#set -g status-justify left
#set -g status-left ""
#set -g status-right "#[fg=green]#H"
# dark theme
#set -g status-bg "#101010"
#set -g status-fg "#005000"
# light theme
#set -g status-bg "#222222"
#set -g status-bg "#303030"
#set -g status-fg "#009000"
# show host name and IP address on left side of status bar
# set -g status-left-length 70
# informational (but takes room)
# set -g status-left "#h #(curl -4 https://icanhazip.com) #(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}') #(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}') #(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}') "
# show session name, window & pane number, date and time on right
# of status bar
#set -g status-right-length 60
# set -g status-right "#S #I:#P %d %b %Y %l:%M %p (#(date -u | awk '{print $4}' | cut -c1-5))"
#set-option -g set-titles on
# Highlight active window
#setw -g window-status-current-fg black
#setw -g window-status-current-bg green
# quiet!
# http://unix.stackexchange.com/questions/169992/why-are-my-windows-highlighted-when-i-first-open-tmux
setw -g monitor-activity off
set -g monitor-silence 0
set -g bell-action none
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set -g bell-action none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment