dogo; better ls

This commit is contained in:
Dict Xiong 2022-06-02 16:03:36 +08:00 committed by GitHub
parent 65546ae452
commit 0b1dfc4ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

17
.zshrc2
View File

@ -71,6 +71,12 @@ antigen apply
# functions
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
SUDO=''
if (( $EUID != 0 )); then
SUDO='sudo'
fi
dfs()
{
case $1 in
@ -89,13 +95,22 @@ dfs()
esac
}
dogo()
{
if [[ -z "$1" || "$1" =~ "-h|--help" ]]; then
echo "usage: dogo <container>"
else
$SUDO docker exec -it $1 zsh
fi
}
# alias
alias "pls"='sudo $(fc -ln -1)'
alias "se"='sudo -sE'
alias "pbd"='ping baidu.com'
alias "p114"='ping 114.114.114.114'
alias "p666"='ping6 2001:da8::666'
alias l='ls -lah --time-style="+%y-%m-%d %H:%M"'
alias l='ls -lAGh --time-style="+%y-%m-%d %H:%M"'
# key bindings
bindkey "^b" beginning-of-line