tmux: better ssh support + add tmuxifier to tmux.conf
This commit is contained in:
parent
db8a39e8b6
commit
7bdff15f80
12
tmux.conf
12
tmux.conf
|
@ -1,5 +1,5 @@
|
||||||
## Behavior ###############
|
## Behavior ###############
|
||||||
####
|
|
||||||
run-shell "~/.dotfiles/tmux/conf.sh"
|
run-shell "~/.dotfiles/tmux/conf.sh"
|
||||||
|
|
||||||
# utf-8
|
# utf-8
|
||||||
|
@ -48,7 +48,7 @@ bind - join-pane
|
||||||
|
|
||||||
# reload config without killing server
|
# reload config without killing server
|
||||||
bind r source-file ~/.tmux.conf \; display-message " Config reloaded..".
|
bind r source-file ~/.tmux.conf \; display-message " Config reloaded..".
|
||||||
bind R refresh-client
|
bind ^r refresh-client
|
||||||
|
|
||||||
# Smart pane switching with awareness of vim splits
|
# Smart pane switching with awareness of vim splits
|
||||||
# See: https://github.com/christoomey/vim-tmux-navigator
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||||
|
@ -121,13 +121,15 @@ setw -g window-status-activity-attr bold,blink
|
||||||
setw -g window-status-activity-bg colour236
|
setw -g window-status-activity-bg colour236
|
||||||
setw -g window-status-activity-fg white
|
setw -g window-status-activity-fg white
|
||||||
|
|
||||||
set -g status-interval 60
|
set -g status-interval 30
|
||||||
set -g status-justify left
|
set -g status-justify left
|
||||||
set -g status-right-length 100
|
set -g status-right-length 100
|
||||||
set -g status-left-length 80
|
set -g status-left-length 80
|
||||||
set -g status-left "#{prefix_highlight}#(~/.dotfiles/tmux/conf-status.sh left) "
|
set -g status-left "#(~/.dotfiles/tmux/conf-status.sh left) "
|
||||||
set -g status-right "#(~/.dotfiles/tmux/conf-status.sh right) "
|
set -g status-right "#(~/.dotfiles/tmux/conf-status.sh right) "
|
||||||
|
|
||||||
set -g window-status-format " #I #W:#T "
|
set -g window-status-format " #I #W:#T "
|
||||||
set -g window-status-current-format " ⮀ #W:#T "
|
set -g window-status-current-format " ▶ #W:#T "
|
||||||
|
|
||||||
|
####
|
||||||
|
run-shell "~/.dotfiles/tmux/prefix_highlight.tmux"
|
||||||
|
|
|
@ -25,14 +25,14 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
STATUS="$DELIM<<$RESET"
|
STATUS="$DELIM<<$RESET"
|
||||||
|
if command -v 'tmux-mem-cpu-load' >/dev/null; then
|
||||||
STATUS+=$SYSINFO
|
STATUS+=$SYSINFO
|
||||||
command -v 'tmux-mem-cpu-load' >/dev/null && STATUS+=' '$(tmux-mem-cpu-load -i 5)
|
STATUS+=' '$(tmux-mem-cpu-load -i 15)
|
||||||
STATUS+=$RESET
|
STATUS+=$RESET
|
||||||
|
fi
|
||||||
STATUS+="$DELIM < $RESET"
|
STATUS+="$DELIM < $RESET"
|
||||||
STATUS+=$IP
|
STATUS+=$IP$(dig +short myip.opendns.com @208.67.222.222)" $RESET"
|
||||||
STATUS+=$(dig +short myip.opendns.com @208.67.222.222)
|
STATUS+=$HOST' '$HOSTNAME' '
|
||||||
STATUS+=' '$RESET$HOST' '
|
|
||||||
STATUS+=$HOSTNAME
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $STATUS
|
echo $STATUS
|
||||||
|
|
|
@ -40,11 +40,10 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If in ssh, use default C-b prefix
|
# If in ssh, use default C-b prefix
|
||||||
if [[ -z "$SSH_CONNECTON" ]]
|
if [[ -z "$SSH_CONNECTION" ]]
|
||||||
then
|
then
|
||||||
# Remap the key prefix
|
# Remap the key prefix
|
||||||
tmux set -g prefix ^c
|
tmux set -g prefix ^c
|
||||||
tmux unbind C-b
|
|
||||||
# Restore sigterm C-c
|
# Restore sigterm C-c
|
||||||
tmux bind C-c send-prefix
|
tmux bind C-c send-prefix
|
||||||
|
|
||||||
|
@ -54,9 +53,13 @@ then
|
||||||
tmux set -g pane-active-border-fg yellow
|
tmux set -g pane-active-border-fg yellow
|
||||||
tmux set -g pane-border-fg colour238
|
tmux set -g pane-border-fg colour238
|
||||||
else
|
else
|
||||||
|
# Remap the key prefix
|
||||||
|
tmux set -g prefix ^a
|
||||||
|
|
||||||
tmux set -g status-bg yellow
|
tmux set -g status-bg yellow
|
||||||
tmux set -g status-fg black
|
tmux set -g status-fg black
|
||||||
|
|
||||||
tmux set -g pane-active-border-fg blue
|
tmux set -g pane-active-border-fg blue
|
||||||
tmux set -g pane-border-fg colour237
|
tmux set -g pane-border-fg colour237
|
||||||
fi
|
fi
|
||||||
|
tmux unbind C-b
|
||||||
|
|
Loading…
Reference in a new issue