Skip to content

Instantly share code, notes, and snippets.

@ksvbka
Last active April 10, 2018 09:06
Show Gist options
  • Select an option

  • Save ksvbka/b97c42092ef133858bd7b415965b34f2 to your computer and use it in GitHub Desktop.

Select an option

Save ksvbka/b97c42092ef133858bd7b415965b34f2 to your computer and use it in GitHub Desktop.
Tmux configuration - By KienLT
##################################
### Custom tmux configuration ###
### by KienLT ###
##################################
# Remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Enable utf8
set-window-option -g utf8 on
# Change history limit from the default 2000
set-option -g history-limit 10000
# Enable the live reload of tmux configuration file
unbind r
bind r source-file ~/.tmux.conf \; display 'Reloaded!'
# vim like screen split
bind s split-window -v
bind v split-window -h
# vim like split screen navigation
# switch panes using Alt-arrow without prefix
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# pane resizing
bind -r h resize-pane -L 2
bind -r j resize-pane -D 2
bind -r k resize-pane -U 2
bind -r l resize-pane -R 2
bind -r M-Left resize-pane -L
bind -r M-Right resize-pane -R
bind -r M-Up resize-pane -U
bind -r M-Down resize-pane -D
# switch window
bind -n S-Left previous-window
bind -n S-Right next-window
# switch window
bin -n M-1 select-window -t :1
bin -n M-2 select-window -t :2
bin -n M-3 select-window -t :3
bin -n M-4 select-window -t :4
bin -n M-5 select-window -t :5
bin -n M-6 select-window -t :6
bin -n M-7 select-window -t :7
bin -n M-8 select-window -t :8
bin -n M-9 select-window -t :9
bin -n M-0 select-window -t :0
# Enable mouse
set-option -g mouse on
# No delay for escape key press
set -g escape-time 0
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
### Colors ###
###---------------------###
# Highlight active pane
set-option -g pane-border-fg colour240
set-option -g pane-active-border-fg colour22
# Colorize messages in the command line
set-option -g message-bg black
set-option -g message-fg brightred
###---------------------###
### Status bar ###
###---------------------###
# Turn on status bar
set-option -g status on
# Enable utf8 for status bar
set -g status-utf8 on
# Set the status bar update frequency
set -g status-interval 10
# Position the status bar
set -g status-justify centre
# Visual notification of activity in other windows
setw -g monitor-activity on
set -g visual-activity on
# Set color for status bar
set-option -g status-bg colour235
set-option -g status-fg yellow
set-option -g status-attr dim
# Set window list colors: active - red, inactive - cyan
set-window-option -g window-status-fg brightblue
set-window-option -g window-status-bg colour236
set-window-option -g window-status-attr dim
set-window-option -g window-status-current-fg brightred
set-window-option -g window-status-current-bg colour235
set-window-option -g window-status-current-attr bright
# Show host name and IP address on left side of status bar
set -g status-left-length 70
# set -g status-left "#[fg=green]: #h : #[fg=brightblue]#(curl icanhazip.com) #[fg=yellow]#(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}') #(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}') #[fg=red]#(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}') "
set -g status-left '#[fg=green,bold]#H#[default]'
# Show session name, window & pane number, dae and time on right side of status bar
set -g status-right-length 60
# set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::"
set -g status-right '|#[fg=magenta,bold]#(load.sh)#[default]| #[fg=blue,bold][%a %d/%m %H:%M]#[default]'
# set -g status-left '#H#[default]'
# set -g status-right '#(cut -d ” ” -f 1-4 /proc/loadavg)#[default] #%Y-%m-%d %H:%M:%S#[default]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment