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 "${@:$#}"
37 subdir="${pwd##$TMPDIR}"
38 if [[ "${PWD%tmp.*}" = "${TMPDIR}" && -n "$subdir" ]]; then
39 tmp_d="${TMPDIR}${subdir%%/*}"
42 rm -fr "$@" "${tmp_d}"
44 echo 'Sorry, not a temporarily taken directory!' >&2
49 function zsh_stats() {
51 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' \
52 | grep -v "./" | column -c3 -s " " -t | sort -nr | nl -w 3 -s ": " | head -n20