summaryrefslogtreecommitdiffstats
path: root/sh/functions
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-30 04:37:32 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-30 04:39:37 -0400
commitbd593bdeb9cd5effed8dc6f017dc8f8db8ff221b (patch)
tree522346cda7cadfdda8ebd7c1791c5f1b8e8fc3b8 /sh/functions
parent24c058fba26cb7f4414e0c25123fc1bab7797e59 (diff)
downloadconf-bd593bdeb9cd5effed8dc6f017dc8f8db8ff221b.tar.gz
conf-bd593bdeb9cd5effed8dc6f017dc8f8db8ff221b.zip
move shared shell files to ~/.sh
Diffstat (limited to 'sh/functions')
-rw-r--r--sh/functions20
1 files changed, 20 insertions, 0 deletions
diff --git a/sh/functions b/sh/functions
new file mode 100644
index 0000000..d6068e0
--- /dev/null
+++ b/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: