Skip to content

Instantly share code, notes, and snippets.

@fseasy
Created November 7, 2016 03:12
Show Gist options
  • Save fseasy/666f5f5338015ffe88dbb9f91dd8363e to your computer and use it in GitHub Desktop.
Save fseasy/666f5f5338015ffe88dbb9f91dd8363e to your computer and use it in GitHub Desktop.
# change it's name to .tmux.conf
#
# author : Xu Xiaodong <[email protected]>
# modified : 2015 May 10
#
#-- base settings --#
set -g default-terminal "screen-256color"
set -g display-time 3000
set -g escape-time 0
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1
#-- bindkeys --#
# prefix key (Ctrl+a)
set -g prefix ^a
unbind ^b
bind a send-prefix
# split window
#unbind '"'
bind - splitw -v # vertical split (prefix -)
#unbind %
bind | splitw -h # horizontal split (prefix |)
# select pane
bind k selectp -U # above (prefix k)
bind j selectp -D # below (prefix j)
bind h selectp -L # left (prefix h)
bind l selectp -R # right (prefix l)
# resize pane
bind -r ^k resizep -U 10 # upward (prefix Ctrl+k)
bind -r ^j resizep -D 10 # downward (prefix Ctrl+j)
bind -r ^h resizep -L 10 # to the left (prefix Ctrl+h)
bind -r ^l resizep -R 10 # to the right (prefix Ctrl+l)
# swap pane
bind ^u swapp -U # swap with the previous pane (prefix Ctrl+u)
bind ^d swapp -D # swap with the next pane (prefix Ctrl+d)
# misc
#bind e lastp # select the last pane (prefix e)
#bind ^e last # select the last window (prefix Ctrl+e)
#bind q killp # kill pane (prefix q)
#bind ^q killw # kill window (prefix Ctrl+q)
# copy mode
bind Escape copy-mode # enter copy mode (prefix Escape)
bind ^p pasteb # paste buffer (prefix Ctrl+p)
bind -t vi-copy v begin-selection # select (v)
bind -t vi-copy y copy-selection # copy (y)
# app
bind ! splitw htop # htop (prefix !)
bind m command-prompt "splitw 'exec man %%'" # man (prefix m)
bind @ command-prompt "splitw 'exec perldoc -t -f %%'" # perl func (prefix @)
bind * command-prompt "splitw 'exec perldoc -t -v %%'" # perl var (prefix *)
#bind % command-prompt "splitw 'exec perldoc -t %%'" # perl doc (prefix %)
bind / command-prompt "splitw 'exec ri %%'" # ruby doc (prefix /)
# reload config (prefix r)
bind r source ~/.tmux.conf \; display "Configuration reloaded!"
#-- statusbar --#
set -g status-utf8 on
set -g status-interval 1
set -g status-keys vi
setw -g mode-keys vi
setw -g automatic-rename off
#-- colorscheme --#
# statusbar
set -g status-justify left
#set -g status-style "fg=#eeeeee,bg=#222222,dim"
set -g status-left "#[default]?"
set -g status-left-length 20
#set -g status-right "#[fg=#7fb8d8]#(uptime) #[default]? #[fg=#7fb8d8]#(cut -d ' ' -f 1-3 /proc/loadavg)"
set -g status-right-length 80
# window
setw -g window-status-format "#I:#W#F"
setw -g window-status-current-format "#I:#W#F"
#setw -g window-status-current-style "fg=#6c7e55,bg=#222222,bold"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment