alias g=git
alias be='bundle exec'
alias docker-shell='docker run --rm --interactive --tty --volume "$PWD:/docker"'
alias ping='ping -c 10'
alias pu=pushd po=popd d='dirs -v'

if command -v exa >/dev/null 2>&1
then alias ls=exa ll='exa --long' la='exa --all' tree='exa --tree'
else alias ls='ls --color=auto' ll='ls -l --human-readable' la='ls --almost-all'
fi

if command -v bat >/dev/null
then alias cat='bat --style=plain'
else alias bat=cat
fi

if [ -f /usr/share/vim/vim81/macros/less.sh ]
then alias vless=/usr/share/vim/vim81/macros/less.sh
elif [ -f /usr/share/vim/vim80/macros/less.sh ]
then alias vless=/usr/share/vim/vim80/macros/less.sh
fi

source_maybe() {
	if [ -f "$1" ]
	then . "$1"
	else return 1
	fi
}

source_maybe ~/.config/posix-sh/local-config.sh

unset -f source_maybe

alias g=git
alias be='bundle exec'
alias docker-shell='docker run --rm --interactive --tty --volume "$PWD:/docker"'
alias ping='ping -c 10'
alias pu=pushd po=popd d='dirs -v'

if command -v exa >/dev/null 2>&1
then alias ls=exa ll='exa --long' la='exa --all' tree='exa --tree'
else alias ls='ls --color=auto' ll='ls -l --human-readable' la='ls --almost-all'
fi

if command -v bat >/dev/null
then alias cat='bat --style=plain'
else alias bat=cat
fi

if [ -f /usr/share/vim/vim81/macros/less.sh ]
then alias vless=/usr/share/vim/vim81/macros/less.sh
elif [ -f /usr/share/vim/vim80/macros/less.sh ]
then alias vless=/usr/share/vim/vim80/macros/less.sh
fi

if [ "`uname`" = Darwin ]
then alias cp='cp -v' mv='mv -v' rm='rm -v'
else alias cp='cp --verbose' mv='mv --verbose' rm='rm --verbose'
fi

source_maybe() {
	if [ -f "$1" ]
	then . "$1"
	else return 1
	fi
}

source_maybe ~/.config/posix-sh/local-config.sh

unset -f source_maybe

Set verbose flag for file utilities
Set verbose flag for file utilities

Note that the entire BSD family doesn't support long flags, not just
Darwin. I may add more complicated detection when I start to use some
BSD (like OpenBSD or FreeBSD). Reference:

https://www.freebsd.org/cgi/man.cgi?query=cp&sektion=1&manpath=FreeBSD+12.2-RELEASE+and+Ports
