Skip to content

Instantly share code, notes, and snippets.

@luisgabrielroldan
Created April 18, 2018 23:22
Show Gist options
  • Save luisgabrielroldan/55cd9157efd8bdb3780e5018b7efee09 to your computer and use it in GitHub Desktop.
Save luisgabrielroldan/55cd9157efd8bdb3780e5018b7efee09 to your computer and use it in GitHub Desktop.
Tmux config
# [ Init options ] {{{1
set-option -g default-command "[ -z \"\${ORIG_PWD_FOR_TMUX+set}\" ] || { cd \"\${ORIG_PWD_FOR_TMUX}\"; unset ORIG_PWD_FOR_TMUX; }; exec ${SHELL}"
set-option -g -a update-environment " ORIG_PWD_FOR_TMUX"
set-option -g history-limit 15000 # Longer history
set-window-option -g mode-keys vi
set-window-option -g monitor-activity on
set-option -g automatic-rename off
set -g mouse on
# }}}1
# [ @plugin ] {{{1
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# }}}
# [ Key bindings ] {{{1
# [ Prefix ]
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# [ Resize panes ]
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
# [ Resize bindinga ]
bind-key -n C-S-Up resize-pane -U 15
bind-key -n C-S-Down resize-pane -D 15
bind-key -n C-S-Left resize-pane -L 25
bind-key -n C-S-Right resize-pane -R 25
# [ Copy-paste bindings ]
bind P paste-buffer
bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -selection c'
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# [ Join panes bindings ]
bind-key S choose-window "join-pane -v -s "%%""
bind-key V choose-window "join-pane -h -s "%%""
# Reload ~/.tmux.conf using PREFIX r
bind r source-file ~/.tmux.conf \; display "Tmux config reloaded!"
# }}}
# [ Colors ] {{{1
#set-option -g default-terminal "screen-256color" #"xterm-256color" # "screen-256color"
set-option -g default-terminal "xterm-256color" # "screen-256color"
set-option -g pane-active-border-fg white
set-option -g pane-border-fg black
set-window-option -g clock-mode-colour colour250 # Clock Color
set-window-option -g clock-mode-style 24
# [ Status Bar ] {{{
set-option -g status-interval 5
set-option -g visual-activity on
# Default Window Title Colors
set-option -g status-bg colour234
set-option -g status-fg colour240
# Active Window Title Colors
set-window-option -g window-status-current-fg colour220
set-window-option -g window-status-current-bg colour234
set-window-option -g window-status-current-fg colour250
setw -g window-status-current-attr default
# New Activity Title Colors
set-option -gw window-status-activity-bg colour233
set-option -gw window-status-activity-fg red
# Left Status
set-option -g status-left-length 30
set-option -g status-left-bg colour234
set-option -g status-left-fg colour220
# Gold Left Status
set-option -g status-left '#[fg=colour220]#S #[fg=colour220]#I #[fg=colour220]#P'
# Gray Left Status
set-option -g status-left '#[fg=colour240]#S #[fg=colour240]#I #[fg=colour240]#P'
# Window Status
set-option -g status-justify centre
setw -g window-status-current-format "#[fg=colour220]|#[default] #W #[fg=colour220]|#[default]"
# Right Status
set-option -g status-right 'Batt: #{battery_percentage} | #[fg=colour240]%R #[default]'
# Titles (window number, program name, active (or not)
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T'
# message text
set-option -g message-bg colour233
set-option -g message-fg colour220
# }}}
# [ Powerline ] {{{1
source /usr/lib/python3.6/site-packages/powerline/bindings/tmux/powerline.conf
# }}}
# [ Plugin manager ] {{{1
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# }}}
# vim: set foldmethod=marker:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment