Skip to content

Instantly share code, notes, and snippets.

@ggsalas
Created August 11, 2019 01:54
Show Gist options
  • Save ggsalas/e45bbb6975c9c735e716fe96ab47b72e to your computer and use it in GitHub Desktop.
Save ggsalas/e45bbb6975c9c735e716fe96ab47b72e to your computer and use it in GitHub Desktop.
Tmux config
unbind-key C-b
set-option -g prefix C-s
bind-key -r C-s send-prefix
set-environment -g "LC_ALL" "en_US.UTF-8"
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color*:Tc:smso"
# Allow us to reload our Tmux configuration while
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# command delay? We don't want that, make it short
set -sg escape-time 1
# Set the numbering of windows to go from 1 instead
# of 0 - silly programmers :|
set-option -g base-index 1
setw -g pane-base-index 1
# Getting interesting now, we use the vertical and horizontal
# symbols to split the screen
bind c new-window -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind \ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Vim navigation
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"
# prefix + C-l to clear screen
bind C-l send-keys 'C-l'
# enable scrolling with mouse
set -g mouse on
# Use vim keybindings in copy mode
setw -g mode-keys vi
# session name complete until 50 chars
set -g status-left-length 50
set -g status-bg '#282828'
set -g status-fg '#bbbbbb'
set -g status-right '#[fg=#bbbbbb,bg=#454545] #(date "+%d %b") #[fg=#333333,bg=#bbbbbb, bold] #(date "+%%H:%%M") '
set -g status-left "#[fg=#333333,bg=#bbbbbb, bold] #S #[bg=#282828] "
set -g status-justify left
setw -g window-status-format '#[fg=#ebbbbbb,bg=#454545, bold] #I #[fg=#333333,bg=#666666, bold] #W #F '
setw -g window-status-current-format '#[fg=#eeeeee,bg=#454545, bold] #I #[fg=#333333,bg=#bbbbbb, bold] #W #F '
# resurrect options
set -g @resurrect-capture-pane-contents 'on'
#################################################################################
# Plugins
# Install: git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run -b '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment