1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # std_functions: Setup standard ("common") functions
4 function open_command() {
10 cygstart "$@" || return 1
13 if [[ -n "$DISPLAY" ]]; then
15 nohup xdg-open "$@" &>/dev/null || return 1
17 xdg-open "$@" || return 1
27 if [[ $# -eq 0 ]]; then
31 mkdir -p "$@" && cd "${@:$#}"
36 if [[ "${PWD%tmp.*}" = "${TMPDIR}" ]]; then
39 rm -fri "$@" "${OLDPWD}"
41 echo 'Sorry, not a temporarily taken directory!' >&2
45 function zsh_stats() {
47 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' \
48 | grep -v "./" | column -c3 -s " " -t | sort -nr | nl -w 3 -s ": " | head -n20