summaryrefslogtreecommitdiffstats
path: root/config/sh/functions
diff options
context:
space:
mode:
Diffstat (limited to 'config/sh/functions')
-rw-r--r--config/sh/functions20
1 files changed, 20 insertions, 0 deletions
diff --git a/config/sh/functions b/config/sh/functions
new file mode 100644
index 0000000..d6068e0
--- /dev/null
+++ b/config/sh/functions
@@ -0,0 +1,20 @@
+function perldoc {
+ # XXX bash specific
+ if type cpandoc > /dev/null 2>&1; then
+ cpandoc "$@"
+ else
+ command perldoc "$@"
+ fi
+}
+
+function cdu {
+ local root
+ root="$(git rev-parse --show-superproject-working-tree 2>/dev/null)"
+ if [ -n "$root" ]; then
+ cd "$root"
+ else
+ cd "$(git rev-parse --show-toplevel)"
+ fi
+}
+
+# vim:ft=sh: