zsh
This commit is contained in:
parent
05ed36ac92
commit
fcff8030dc
3 changed files with 3 additions and 23 deletions
|
|
@ -22,6 +22,8 @@ alias lla='ls -la --color'
|
||||||
alias llh='ls -lh --color'
|
alias llh='ls -lh --color'
|
||||||
alias llah='ls -lah --color'
|
alias llah='ls -lah --color'
|
||||||
|
|
||||||
|
alias su='us -'
|
||||||
|
|
||||||
alias n='nnn -diUxe'
|
alias n='nnn -diUxe'
|
||||||
|
|
||||||
alias vi=vim
|
alias vi=vim
|
||||||
|
|
|
||||||
|
|
@ -23,25 +23,3 @@ s() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
sshr() {
|
|
||||||
if [ -n "$TMUX" ]; then
|
|
||||||
local original_name
|
|
||||||
original_name=$(tmux display-message -p '#W')
|
|
||||||
|
|
||||||
local ssh_host="$1"
|
|
||||||
ssh_host="${ssh_host#*@}"
|
|
||||||
ssh_host="${ssh_host%%:*}"
|
|
||||||
ssh_host="${ssh_host%% *}"
|
|
||||||
|
|
||||||
# Emit title update BEFORE ssh
|
|
||||||
printf '\033k%s\033\\' "${ssh_host%%.*}"
|
|
||||||
|
|
||||||
command ssh "$@"
|
|
||||||
|
|
||||||
# Restore after disconnect
|
|
||||||
printf '\033k%s\033\\' "$original_name"
|
|
||||||
else
|
|
||||||
command ssh "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ us() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Rename the window before running su
|
# Rename the window before running su
|
||||||
tmux rename-window "su-${target_user}"
|
tmux rename-window "su(${target_user})"
|
||||||
|
|
||||||
# Use "command su" to bypass the function if it exists
|
# Use "command su" to bypass the function if it exists
|
||||||
command su "$@"
|
command su "$@"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue