mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 06:27:03 +08:00
zshrc: ls multisystem fix (#10)
1. alias l according to the local os type 2. ci sync triggered by all branches
This commit is contained in:
parent
7804f196b4
commit
f313a6887e
5
.github/workflows/gitee_sync.yml
vendored
5
.github/workflows/gitee_sync.yml
vendored
|
@ -1,9 +1,6 @@
|
|||
name: sync repos to gitee
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
push: ~
|
||||
schedule:
|
||||
- cron: 10 4 * * *
|
||||
workflow_dispatch: ~
|
||||
|
|
37
.zshrc2
37
.zshrc2
|
@ -76,6 +76,38 @@ if (( $EUID != 0 )); then
|
|||
SUDO='sudo'
|
||||
fi
|
||||
|
||||
get_os_type() {
|
||||
case "$(uname -s)" in
|
||||
Darwin*) ans="MacOS";;
|
||||
CYGWIN*) ans="Cygwin";;
|
||||
MSYS* ) ans="MSYS";;
|
||||
Linux* ) ans="Linux";;
|
||||
*) ans="unknown";;
|
||||
esac
|
||||
echo $ans | tr '[:upper:]' '[:lower:]'
|
||||
}
|
||||
|
||||
get_linux_dist() {
|
||||
if [ -f /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
ans=$ID
|
||||
elif type lsb_release >/dev/null 2>&1; then
|
||||
ans=$(lsb_release -si)
|
||||
elif [ -f /etc/lsb-release ]; then
|
||||
. /etc/lsb-release
|
||||
ans=$DISTRIB_ID
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
ans=Debian
|
||||
elif [ -f /etc/SuSe-release ]; then
|
||||
ans=SUSE
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
ans=RedHat
|
||||
else
|
||||
ans=unknown
|
||||
fi
|
||||
echo $ans | tr '[:upper:]' '[:lower:]'
|
||||
}
|
||||
|
||||
dfs()
|
||||
{
|
||||
case $1 in
|
||||
|
@ -117,7 +149,10 @@ 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 -lAGh --time-style="+%y-%m-%d %H:%M"'
|
||||
case $(get_os_type) in
|
||||
macos ) alias l='ls -lAGh -D "%y-%m-%d %H:%M"' ;;
|
||||
* ) alias l='ls -lAGh --time-style="+%y-%m-%d %H:%M"' ;;
|
||||
esac
|
||||
|
||||
# key bindings
|
||||
bindkey "^b" beginning-of-line
|
||||
|
|
|
@ -18,12 +18,8 @@ apk_add()
|
|||
apk update
|
||||
|
||||
# mass installation
|
||||
apk add zsh git tmux vim curl wget bash python3 htop gcc g++ cmake make fzf perl linux-headers bind-tools iputils man-db
|
||||
apk add zsh git tmux vim curl wget bash python3 htop gcc g++ cmake make fzf perl linux-headers bind-tools iputils man-db coreutils
|
||||
#for i in {fzf,ripgrep}; do apk add $i -y; done
|
||||
|
||||
# who am i
|
||||
git config --global user.email "me@beardic.cn"
|
||||
git config --global user.name "Dict Xiong"
|
||||
}
|
||||
|
||||
set_timezone()
|
||||
|
|
Loading…
Reference in New Issue
Block a user