Skip to content

Instantly share code, notes, and snippets.

@adong
Created May 1, 2019 19:59
Show Gist options
  • Save adong/6e9f1928e348c23052ec918ba34fbc42 to your computer and use it in GitHub Desktop.
Save adong/6e9f1928e348c23052ec918ba34fbc42 to your computer and use it in GitHub Desktop.
Tmux Config 2.9

This Version is for tmux 2.9

# Update config from tmux 2.9
# Issue: https://gitlab.com/fernandobasso/dotfiles/commit/af2c0ac59b93b318575367f0313ad1ca0627a6ba
# Migration: https://gist.github.com/tbutts/6abf7fb5b948c066bf180922fb37adcf

set-option -g default-command "reattach-to-user-namespace -l zsh"

# -- set the mouse gesture on --#
#set -g mode-mouse on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
set-option -g mouse on

#-- set the status bar --#
set-option -g status on
set-option -g status-interval 2
# set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 90

#-- base --#

set -g default-terminal "screen-256color"
set -g display-time 3000
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1
set -s escape-time 0

#-- bindkeys --#

#-- change ^b to ^a
#set -g prefix ^a
#unbind ^b
#bind a send-prefix

unbind '"'
bind - splitw -v
unbind %
bind | splitw -h

bind k selectp -U
bind j selectp -D
bind h selectp -L
bind l selectp -R

bind ^k resizep -U 5
bind ^j resizep -D 5
bind ^h resizep -L 5
bind ^l resizep -R 5

bind ^u swapp -U
bind ^d swapp -D

bind ^e last
bind q killp

bind '~' splitw htop
bind ! splitw ncmpcpp
bind m command-prompt "splitw -h 'exec man %%'"
bind @ command-prompt "splitw 'exec perldoc -t -f %%'"
bind * command-prompt "splitw 'exec perldoc -t -v %%'"
bind % command-prompt "splitw 'exec perldoc -t %%'"
bind / command-prompt "splitw 'exec ri -T %% | less'"

#bind r source-file ~/.tmux.conf \; display "Reloaded!"

#-- statusbar --#

set -g status-justify centre

set -g status-left "#[fg=green]#S:w#I.p#P#[default]"
set -g status-left-style bright
set -g status-left-length 20

set -g status-right "#[fg=green]#(/home/xiaodong/bin/uptime)#[default] • #[fg=green]#(cut -d ' ' -f 1-3 /proc/loadavg)#[default]"
set -g status-right-style bright

# set -g status-utf8 on
set -g status-interval 1

set -g visual-activity on
setw -g monitor-activity on

setw -g automatic-rename off

set -g status-keys vi
setw -g mode-keys vi

#set -g status-bg black
#set -g status-fg yellow

#setw -g window-status-current-attr bright
#setw -g window-status-current-bg red
#setw -g window-status-current-fg white

#-- colorscheme --#
#-- see also: https://github.com/seebi/tmux-colors-solarized --#

# default statusbar colors
set -g status-style bg=colour235,fg=colour136,default

# default window title colors
setw -g window-status-style fg=colour244,bg=default
#setw -g window-status-attr dim

# active window title colors
setw -g window-status-current-style fg=colour166,bg=default
#setw -g window-status-current-attr bright

# pane border
set -g pane-border-style fg=colour235
set -g pane-active-border-style fg=colour240

# message text
set -g message-style bg=colour235,fg=colour166

# pane number display
set -g display-panes-active-colour colour33 #blue
set -g display-panes-colour colour166 #orange

# clock
setw -g clock-mode-colour colour64 #green

#-- apps --#

# new -s funtoy vim
# neww -n root zsh
# neww -n zsh zsh

# selectw -t 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment