Last active
October 25, 2020 19:14
-
-
Save mauriballes/5a4bfd831eb25fd30ea4417f7fecf7fa to your computer and use it in GitHub Desktop.
Tmux Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remap prefix from 'C-b' to 'C-a' | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# split panes using | and - | |
bind | split-window -h | |
bind - split-window -v | |
unbind '"' | |
unbind % | |
# reload config file (change file location to your the tmux.conf you want to use) | |
bind r source-file ~/.tmux.conf | |
# switch panes using Alt-arrow without prefix | |
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 | |
# Enable mouse mode (tmux 2.1 and above) | |
set -g mouse on | |
# don't rename windows automatically | |
set-option -g allow-rename off | |
# status bar | |
set-window-option -g window-status-format "" | |
set-window-option -g window-status-current-format "" | |
# set color for status bar | |
set-option -g status-style bg=colour235,fg=yellow,default | |
# show IP addresses on left side of status bar | |
set -g status-left-length 120 | |
DEFAULT_GW="$(route -n get default|grep gateway |cut -f2 -d\":\")" | |
set -g status-left "#[fg=green][#P] #[fg=brightblue]#(curl icanhazip.com) #[fg=yellow]#(ifconfig en0 | grep 'inet ' | awk '{print \"lan \"$2}')#[fg=red]#(ifconfig utun0 | grep 'inet ' | awk '{print \"vpn \" $2}') #[fg=red]#(ifconfig utun1 | grep 'inet ' | awk '{print \"vpn \" $2}') #[fg=white]8.8.8.8 (#(ping -c1 8.8.8.8 | grep time |cut -f4 -d'='))#[fg=white]#(route -n get default|grep gateway |cut -f2 -d\":\") (#(ping -c1 $DEFAULT_GW | grep time |cut -f4 -d'='))" | |
set -g status-right-length 60 | |
set -g status-right "#[fg=yellow]%d %b %Y #[fg=green]%H:%M" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment