Skip to content

Instantly share code, notes, and snippets.

@chhaileng
Last active June 9, 2022 02:25
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 chhaileng/0cd21659a26b6703badb08c549f702dc to your computer and use it in GitHub Desktop.
Save chhaileng/0cd21659a26b6703badb08c549f702dc to your computer and use it in GitHub Desktop.
My tmux configuration
# ~/.tmux.conf
# Change prefix
set -g prefix C-a
bind C-a send-prefix
unbind C-b
# Join windows
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
# Search mode
set-window-option -g mode-keys vi
set-option -g history-limit 3000
set -g default-terminal "screen-256color"
#bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Hack the box environment
set-option -g status-left-length 30
set -g status-interval 5
set-option -g status-left "[#S - #(echo `if test -f /sys/class/net/tun0/operstate; then ifconfig tun0|grep inet|xargs|cut -d' ' -f2; else echo VPN Not Connected; fi`)] "
# Use for save tmux session
# git clone https://github.com/tmux-plugins/tmux-resurrect
# Prefix + Ctrl + s => to save
# Prefix + Ctrl + r => to restore
run-shell /opt/tmux-resurrect/resurrect.tmux
@chhaileng
Copy link
Author

chhaileng commented Jun 9, 2022

set-option -g history-limit 3000

# Change prefix
set -g prefix C-a
bind C-a send-prefix
unbind C-b

# Search mode
set-window-option -g mode-keys vi

#bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"

set-option -g status-left-length 30
set -g status-interval 5
set-option -g status-left "[#S - #(echo `if test -f /sys/class/net/tun0/operstate; then ifconfig tun0|grep inet|xargs|cut -d' ' -f2; else echo VPN Not Connected; fi`)] "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment