Skip to content

Instantly share code, notes, and snippets.

@jose-lopes
Created June 11, 2019 21:54
Show Gist options
  • Save jose-lopes/7715fc2fb535b4230e2ca347f6bc286f to your computer and use it in GitHub Desktop.
Save jose-lopes/7715fc2fb535b4230e2ca347f6bc286f to your computer and use it in GitHub Desktop.
my tmux.conf
# Config file inspired at
## https://raw.githubusercontent.com/tony/tmux-config/master/.tmux.conf
# START COLORSCHEME: gruvbox dark
# https://raw.githubusercontent.com/egel/tmux-gruvbox/master/tmux-gruvbox-dark.conf
set-option -g status "on"
# default statusbar color
set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
# default window title colors
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
# default window with an activity alert
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
# active window title colors
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
# pane border
set-option -g pane-active-border-style fg=colour250 #fg2
set-option -g pane-border-style fg=colour237 #bg1
# message infos
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
# writing commands inactive
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
# pane number display
set-option -g display-panes-active-colour colour250 #fg2
set-option -g display-panes-colour colour237 #bg1
# clock
set-window-option -g clock-mode-colour colour109 #blue
# bell
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
set-option -g status-justify "left"
set-option -g status-left-style none
set-option -g status-left-length "80"
set-option -g status-right-style none
set-option -g status-right-length "80"
set-window-option -g window-status-separator ""
set-option -g status-left "#[fg=colour248, bg=colour241] #S #[fg=colour241, bg=colour237, nobold, noitalics, nounderscore]"
set-option -g status-right "#[fg=colour239, bg=colour237, nobold, nounderscore, noitalics]#[fg=colour246,bg=colour239] %Y-%m-%d  %H:%M #[fg=colour248, bg=colour239, nobold, noitalics, nounderscore]#[fg=colour237, bg=colour248] #h "
set-window-option -g window-status-current-format "#[fg=colour237, bg=colour214, nobold, noitalics, nounderscore]#[fg=colour239, bg=colour214] #I #[fg=colour239, bg=colour214, bold] #W #[fg=colour214, bg=colour237, nobold, noitalics, nounderscore]"
set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I #[fg=colour223, bg=colour239] #W #[fg=colour239, bg=colour237, noitalics]"
# END COLOR SCHEME
set-option -g status-right "#[fg=colour248, bg=colour237, nobold, noitalics, nounderscore]#[fg=colour237, bg=colour248] #h "
set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I:#[fg=colour223, bg=colour239]#W #[fg=colour239, bg=colour237, noitalics]"
set-window-option -g window-status-current-format "#[fg=colour237, bg=colour214, nobold, noitalics, nounderscore]#[fg=colour239, bg=colour214] #I:#[fg=colour239, bg=colour214, bold]#W #[fg=colour214, bg=colour237, nobold, noitalics, nounderscore]"
# set window split
bind-key v split-window -h
bind-key b split-window
# 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
# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# set to main-horizontal, 66% height for main pane
bind m run-shell "~/.tmux/scripts/resize-adaptable.sh -l main-horizontal -p 66"
# Same thing for verical layouts
bind M run-shell "~/.tmux/scripts/resize-adaptable.sh -l main-vertical -p 50"
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
# Vi copypaste mode
set-window-option -g mode-keys vi
bind-key -Tcopy-mode-vi v send -X begin-selection
bind-key -Tcopy-mode-vi y send -X copy-selection-and-cancel
# status bar
set-option -g status-utf8 on
# disable mouse
set -g mouse off
# support 24-bit color on termite
set -ga terminal-overrides ",xterm-termite:Tc"
set -g default-terminal "xterm-termite"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment