Skip to content

Instantly share code, notes, and snippets.

@v-i-s-h
Last active July 26, 2023 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v-i-s-h/7f7590f8d631c3854f4e3ed4f5d595d6 to your computer and use it in GitHub Desktop.
Save v-i-s-h/7f7590f8d631c3854f4e3ed4f5d595d6 to your computer and use it in GitHub Desktop.
tmux configuration
# Destination: ~/.tmux.conf
# from powerline
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# default shell
# set-option -g default-command /bin/zsh
# set-option -g default-shell /bin/zsh
# color
# set -g default-terminal "tmux-256color"
# set -ag terminal-overrides ",xterm-256color:RGB"
set -g default-terminal "screen-256color"
# Make Ctrl-a
unbind C-b
set-option -g prefix C-a
bind-key C-a last-window
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
# auto window rename
set-window-option -g automatic-rename
set -g renumber-windows on # renumber windows when a window is closed
# set -g set-titles on # set terminal titl
# Allows for faster key repetition
set -s escape-time 0
# status bar
# set-option -g status-utf8 on
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
# set-option -g status-attr default
# default window title colors
# set-window-option -g window-status-fg white #base0
# set-window-option -g window-status-bg default
# set-window-option -g window-status-attr dim
# active window title colors
# set-window-option -g window-status-current-fg white #orange
# set-window-option -g window-status-current-bg default
# set-window-option -g window-status-current-attr bright
# pane border
# set-option -g pane-border-fg colour235 #base02
# set-option -g pane-active-border-fg colour240 #base01
# message text
# set-option -g message-bg colour235 #base02
# set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour green #green
# Variables used in time format
# Source: http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Commontimeformatvariables
# %y = year in numbers (2-digit)
# %Y = year in numbers (4-digit)
# %m = month in number (eg: 12)
# %B = full month name (eg: December)sho
# %b = short month name (eg: Dec)
# %d = day in numbers, with leading zeros (eg: 08)
# %e = day in numbers, no leading zeros (eg: 8)
# %A = full weekday name (eg: Sunday)
# %a = short weekday name (eg: Sun)
# %H = hours in 24-clock, with leading zeros
# %k = hours in 24-clock, no leading zeros
# %l = hours in 12-clock, with leading zeros
# %p = am/pm
# %T = time in 24-hour notation (%H:%M:%S)
set -g status-interval 1
set -g status-left-length 20
set -g status-left '#[fg=white,dim]#(whoami)@#(hostname )#[default] • '
# set -g status-left '#[fg=white,dim]#(uptime -p)#[default] • '
# set -g status-left '#[fg=white]#(whoami)@#(hostname)#[default] • #{?window_zoomed_flag,🔍, }•'
# set -g status-right '#[fg=white,bg=default]#(uptime | awk \"{print \\$3}\"|sed \"s/,//\") #[fg=white,bg=default]%a %d-%m-%Y %H:%M:%S'
set -g status-right '#[fg=white,dim]%a %b %e • #[default]#[fg=white,bg=default]%l:%M %p'
# 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 off
set -g visual-activity off
set-option -g bell-action none
# Highlight active window
#set-window-option -g window-status-current-bg red
# Vi copypaste mode
# set-window-option -g mode-keys vi
# bind-key -t vi-copy 'v' begin-selection
# bind-key -t vi-copy 'y' copy-selection
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# Split keys
bind S split-window -v
bind | split-window -h
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# auto window rename
set-window-option -g automatic-rename
# rm mouse mode fail
# set -g mode-mouse off
# Destination: ~/.tmux.conf
# from powerline
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# color
# set -g default-terminal "tmux-256color"
# set -ag terminal-overrides ",xterm-256color:RGB"
set -g default-terminal "screen-256color"
# Make Ctrl-a
unbind C-b
set-option -g prefix C-a
bind-key C-a last-window
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
# auto window rename
set-window-option -g automatic-rename
set -g renumber-windows on # renumber windows when a window is closed
# set -g set-titles on # set terminal titl
# 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 off
set -g visual-activity off
set-option -g bell-action none
# Highlight active window
#set-window-option -g window-status-current-bg red
# Vi copypaste mode
# set-window-option -g mode-keys vi
# bind-key -t vi-copy 'v' begin-selection
# bind-key -t vi-copy 'y' copy-selection
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# Split keys
bind S split-window -v
bind | split-window -h
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# auto window rename
set-window-option -g automatic-rename
# rm mouse mode fail
# set -g mode-mouse off
# status bar
# set-option -g status-utf8 on
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
# DARK
# set-option -g status-bg colour235 #base02
# set-option -g status-fg colour136 #yellow
# LIGHT
set-option -g status-style fg=yellow,bg=white #yellow and base2
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour green #green
# Variables used in time format
# Source: http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Commontimeformatvariables
# %y = year in numbers (2-digit)
# %Y = year in numbers (4-digit)
# %m = month in number (eg: 12)
# %B = full month name (eg: December)sho
# %b = short month name (eg: Dec)
# %d = day in numbers, with leading zeros (eg: 08)
# %e = day in numbers, no leading zeros (eg: 8)
# %A = full weekday name (eg: Sunday)
# %a = short weekday name (eg: Sun)
# %H = hours in 24-clock, with leading zeros
# %k = hours in 24-clock, no leading zeros
# %l = hours in 12-clock, with leading zeros
# %p = am/pm
# %T = time in 24-hour notation (%H:%M:%S)
set -g status-interval 1
set -g status-left-length 20
set -g status-left '#[fg=brown,dim]#(whoami)@#(hostname )#[default] • '
set -g status-right '#[fg=brown,dim]%a %b %e • #[default]#[fg=brown,dim]%l:%M %p'
# Destination: ~/.tmux.conf
# from powerline
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# color
# set -g default-terminal "tmux-256color"
# set -ag terminal-overrides ",xterm-256color:RGB"
set -g default-terminal "screen-256color"
# Make Ctrl-a
unbind C-b
set-option -g prefix C-a
bind-key C-a last-window
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
# auto window rename
set-window-option -g automatic-rename
set -g renumber-windows on # renumber windows when a window is closed
# set -g set-titles on # set terminal titl
# Allows for faster key repetition
set -s escape-time 0
# status bar
# set-option -g status-utf8 on
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
# set-option -g status-attr default
# default window title colors
# set-window-option -g window-status-fg white #base0
# set-window-option -g window-status-bg default
# set-window-option -g window-status-attr dim
# active window title colors
# set-window-option -g window-status-current-fg white #orange
# set-window-option -g window-status-current-bg default
# set-window-option -g window-status-current-attr bright
# pane border
# set-option -g pane-border-fg colour235 #base02
# set-option -g pane-active-border-fg colour240 #base01
# message text
# set-option -g message-bg colour235 #base02
# set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour green #green
# Variables used in time format
# Source: http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Commontimeformatvariables
# %y = year in numbers (2-digit)
# %Y = year in numbers (4-digit)
# %m = month in number (eg: 12)
# %B = full month name (eg: December)sho
# %b = short month name (eg: Dec)
# %d = day in numbers, with leading zeros (eg: 08)
# %e = day in numbers, no leading zeros (eg: 8)
# %A = full weekday name (eg: Sunday)
# %a = short weekday name (eg: Sun)
# %H = hours in 24-clock, with leading zeros
# %k = hours in 24-clock, no leading zeros
# %l = hours in 12-clock, with leading zeros
# %p = am/pm
# %T = time in 24-hour notation (%H:%M:%S)
set -g status-interval 1
set -g status-left-length 20
set -g status-left '#[fg=white,dim]#(whoami)@#(hostname )#[default] • '
# set -g status-left '#[fg=white,dim]#(uptime -p)#[default] • '
# set -g status-left '#[fg=white]#(whoami)@#(hostname)#[default] • #{?window_zoomed_flag,🔍, }•'
# set -g status-right '#[fg=white,bg=default]#(uptime | awk \"{print \\$3}\"|sed \"s/,//\") #[fg=white,bg=default]%a %d-%m-%Y %H:%M:%S'
set -g status-right '#[fg=white,dim]%a %b %e • #[default]#[fg=white,bg=default]%l:%M %p'
# 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 off
set -g visual-activity off
set-option -g bell-action none
# Highlight active window
#set-window-option -g window-status-current-bg red
# Vi copypaste mode
# set-window-option -g mode-keys vi
# bind-key -t vi-copy 'v' begin-selection
# bind-key -t vi-copy 'y' copy-selection
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# Split keys
bind S split-window -v
bind | split-window -h
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# auto window rename
set-window-option -g automatic-rename
# rm mouse mode fail
# set -g mode-mouse off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment