mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 10:47:00 +08:00
dogo; better ls
This commit is contained in:
parent
65546ae452
commit
0b1dfc4ecf
17
.zshrc2
17
.zshrc2
|
@ -71,6 +71,12 @@ antigen apply
|
||||||
|
|
||||||
# functions
|
# functions
|
||||||
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||||
|
|
||||||
|
SUDO=''
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
SUDO='sudo'
|
||||||
|
fi
|
||||||
|
|
||||||
dfs()
|
dfs()
|
||||||
{
|
{
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -89,13 +95,22 @@ dfs()
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dogo()
|
||||||
|
{
|
||||||
|
if [[ -z "$1" || "$1" =~ "-h|--help" ]]; then
|
||||||
|
echo "usage: dogo <container>"
|
||||||
|
else
|
||||||
|
$SUDO docker exec -it $1 zsh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# alias
|
# alias
|
||||||
alias "pls"='sudo $(fc -ln -1)'
|
alias "pls"='sudo $(fc -ln -1)'
|
||||||
alias "se"='sudo -sE'
|
alias "se"='sudo -sE'
|
||||||
alias "pbd"='ping baidu.com'
|
alias "pbd"='ping baidu.com'
|
||||||
alias "p114"='ping 114.114.114.114'
|
alias "p114"='ping 114.114.114.114'
|
||||||
alias "p666"='ping6 2001:da8::666'
|
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
|
# key bindings
|
||||||
bindkey "^b" beginning-of-line
|
bindkey "^b" beginning-of-line
|
||||||
|
|
Loading…
Reference in New Issue
Block a user