Skip to content

Instantly share code, notes, and snippets.

@Efimenko
Created January 20, 2020 11:56
Show Gist options
  • Select an option

  • Save Efimenko/38e7b2f3197987b202f10761efbc0dc1 to your computer and use it in GitHub Desktop.

Select an option

Save Efimenko/38e7b2f3197987b202f10761efbc0dc1 to your computer and use it in GitHub Desktop.
unbind C-b
set-option -g prefix `
bind-key ` send-prefix
set -s escape-time 0
set -g focus-events on
# shell
set -g default-command /bin/zsh
set -g default-shell /bin/zsh
# start with window 1 (instead of 0)
set -g base-index 1
# start with pane 1
set -g pane-base-index 1
# screen mode
set -g default-terminal 'tmux-256color'
set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m'
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# history
set -g history-limit 4060
# use vi mode
setw -g mode-keys vi
set -g status-keys vi
# splitting panes
bind \ split-window -h
bind - split-window -v
# colon :
bind : command-prompt
# pane resizing
STEP=5
bind -r H resize-pane -L $STEP
bind -r J resize-pane -D $STEP
bind -r K resize-pane -U $STEP
bind -r L resize-pane -R $STEP
# moving between panes with vim movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# use mouse in copy mode
set -g mouse on
# quit from copy mode like from normal to insert mode
bind -T copy-mode-vi i send-keys -X cancel
# Setup 'v' to begin selection as in Vim
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
# loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# some key-binding changes
bind x kill-pane
bind X next-layout
bind Z previous-layout
# Automatically set window title
setw -g automatic-rename on
set -g set-titles on
set -g allow-rename off
# clear history
# bind u send-keys C-l \; run-shell "sleep .3s" \; clear-history
bind-key -n C-l send-keys C-z \; send-keys " reset && fg > /dev/null" \; send-keys "Enter"
# ==========================
# UI
# ==========================
#
# COLORS:
COLOR_GREEN="colour148"
COLOR_IRIS_DIM="colour197"
COLOR_IRIS="colour141"
COLOR_NORMAL_DARK="colour235"
COLOR_GRAY="colour242"
COLOR_GRAY_DARK="colour239"
COLOR_BLUE="colour81"
RESET="#[fg=$COLOR_GRAY,bg=default,nobold,nounderscore,noitalics]"
# WIDGETS:
# show local ip
IP_ADDRES="#(ipconfig getifaddr en0)"
# spotify
SPOTIFY="#[fg=$COLOR_GREEN] 阮#(spotifyInfo)"
# cpu usage
CPU_USAGE="﬙#(getCpuUsage)"
# battery status with witch AC
BATTERY_STAT="#(getBatteryStats)"
# date time now
DATE_TIME="#[fg=$COLOR_NORMAL_DARK, bold]%d/%m %a %R "
# current dir with highligh prefix
PWD_W_PREFIX="#[fg=$COLOR_NORMAL_DARK,bold]#{?client_prefix,#[bg=$COLOR_BLUE],#[bg=$COLOR_BLUE]} #{b:pane_current_path} "
# lognme + hostname with highligh prefix
LOGNAME_W_PREFIX="#[fg=$COLOR_NORMAL_DARK,bold]#{?client_prefix,#[bg=$COLOR_BLUE],#[bg=$COLOR_BLUE]} #(whoami)@#(hostname) "
# STATUS
set -g status "on"
set -g status-style none
set -g status-right-style none
set -g status-left-style none
set -g status-style bg=default
set -g status-position top
set -g status-justify "left"
set -g status-left-length "100"
set -g status-right-length "160"
set -g status-left "#$PWD_W_PREFIX#$RESET"
set -g status-right "$SPOTIFY #[fg=$COLOR_NORMAL_DARK]#[bg=$COLOR_BLUE] $CPU_USAGE  $BATTERY_STAT  $DATE_TIME"
# PANE
set -g pane-border-style bg=default,fg=$COLOR_IRIS
set -g pane-active-border-style bg=default,fg=$COLOR_GREEN
# MESSAGE
set -g message-style bg=$COLOR_GREEN,fg=$COLOR_NORMAL_DARK
# WINDOW
setw -g window-status-style bg=default,fg=$COLOR_GRAY,none
setw -g window-status-current-style bg=default,fg=$COLOR_GRAY
setw -g window-status-activity-style fg=$COLOR_GREEN,none
setw -g window-status-separator ""
setw -g window-status-format "$RESET#[fg=$COLOR_GRAY,bold] #W#F "
setw -g window-status-current-format "#[bg=$COLOR_GREEN,bold]#[fg=$COLOR_NORMAL_DARK] #W#F "
# Initialize TMUX plugin manager
# run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment