]> arthur.barton.de Git - ax-zsh.git/blobdiff - default_plugins/std_functions/std_functions.zshrc
New "std_functions" default plugin
[ax-zsh.git] / default_plugins / std_functions / std_functions.zshrc
diff --git a/default_plugins/std_functions/std_functions.zshrc b/default_plugins/std_functions/std_functions.zshrc
new file mode 100644 (file)
index 0000000..fd3378a
--- /dev/null
@@ -0,0 +1,12 @@
+# AX-ZSH: Alex' Modular ZSH Configuration
+# std_functions: Setup standard ("common") functions
+
+function take() {
+       mkdir -p "$@" && cd "${@:$#}"
+}
+
+function zsh_stats() {
+       fc -l 1 \
+       | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' \
+       | grep -v "./" | column -c3 -s " " -t | sort -nr | nl -w 3 -s ": " | head -n20
+}