Skip to content

Instantly share code, notes, and snippets.

@evenme
Last active March 29, 2021 04:04
Show Gist options
  • Save evenme/46e58a0a5c67e3f868b69d3cb551dc99 to your computer and use it in GitHub Desktop.
Save evenme/46e58a0a5c67e3f868b69d3cb551dc99 to your computer and use it in GitHub Desktop.
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-style fg=colour136,bg=colour235 #yellow and base02
# set window split
bind-key v split-window -h
bind-key b split-window
# set ctrl + arrows navegate words
set-window-option -g xterm-keys on
# default window title colors
#set-window-option -g window-status-attr dim
set-window-option -g window-status-style fg=colour244,bg=default #base0 and default
# active window title colors
#set-window-option -g window-status-current-attr bright
set-window-option -g window-status-current-style fg=colour166,bg=default #orange and default
# pane border
set-option -g pane-border-style fg=colour235 #base02
set-option -g pane-active-border-style fg=colour240 #base01
# message text
set-option -g message-style fg=colour166,bg=colour235 #orange and base02
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour green #green
# status bar
set -g focus-events on
set -g status-interval 1
set -g status-justify centre # center align window list
set -g status-left-length 20
set -g status-right-length 140
set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]'
set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load -a 1 -g 0 -i 1) #[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=white,bg=default]%a %l:%M:%S%p#[default] #[fg=blue]%Y-%m-%d'
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# Start numbering at 1
set -g base-index 1
# 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*. Much more reasonable.
#setw -g aggressive-resize on
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Activity monitoring
setw -g monitor-activity on
#set -g visual-activity on
# Vi copypaste mode
set-window-option -g mode-keys vi
# OSX config
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
#set-option -g default-command "reattach-to-user-namespace -l zsh"
# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# auto window rename
#set-window-option -g automatic-rename off
#set-option -g default-command "tmux rename-window zsh; reattach-to-user-namespace -l zsh"
#set-option -g status-interval 1
set-window-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# Dynamically update iTerm tab and window titles.
set -g set-titles on
# Needed as on tmux 1.9 and up (defaults to off).
# Added in tmux commit c7a121cfc0137c907b7bfb.
set -g focus-events on
# Renumber windows automatically after removing a window
set-option -g renumber-windows on
# #T = standard window title (last command, see ~/.bash_profile)
# #h = short hostname
# #S = session name
# #W = tmux window name
#
# (Would love to include #(pwd) here as well, but that would only print the
# current working directory relative to the session -- ie. always the starting
# cwd -- which is not very interesting).
set -g set-titles-string "#T : #h > #S > #W"
# rm mouse mode fail
#set -g mode-mouse off
# color
set -g default-terminal "screen"
### determine if we should enable 256-colour support
# if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
set -g default-terminal "screen-256color"
# default shell zsh
set-option -g default-shell /bin/zsh
# history limit
set -g history-limit 50000
# https://github.com/edkolev/dots/blob/master/tmux.conf
# Updates for tmux 1.9's current pane splitting paths.
if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind c; bind c new-window -c "#{pane_current_path}"'
if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind s; bind s split-window -v -c "#{pane_current_path}"'
if-shell "[[ `tmux -V` == *1.9* ]]" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'"
if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind v; bind v split-window -h -c "#{pane_current_path}"'
if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind %; bind % split-window -h -c "#{pane_current_path}"'
# SSH_AUTH_SOCK
set-option -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION DISPLAY"
## Required by MacOS Sierra and Sierra High.
# set -g default-command "-l $SHELL"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @continuum-restore 'on'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run "$DOTFILES/tmux/plugins/tpm/tpm"
# The condition in the tmux-sensible plugin does not seem to be working...
# This line is required since updating to Sierra High.
set-window-option -g aggressive-resize off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment