aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
authorgregstallings <gregstallings@gmail.com>2013-10-23 13:53:26 +0200
committerMathias Bynens <mathias@qiwi.be>2013-10-23 13:54:00 +0200
commit3459ae7f86cc8a2dad7440f012bb3a19c0585294 (patch)
treec13b0c0e7a6bd07cb0957cb4dd8dadfc8af258e6 /.functions
parent7669dfde2975b1c7391fafe24eadfb92eb687dd2 (diff)
downloaddotfiles-3459ae7f86cc8a2dad7440f012bb3a19c0585294.tar.gz
dotfiles-3459ae7f86cc8a2dad7440f012bb3a19c0585294.tar.bz2
dotfiles-3459ae7f86cc8a2dad7440f012bb3a19c0585294.zip
.functions: Add `tre` shorthand
Closes #249.
Diffstat (limited to '.functions')
-rw-r--r--.functions8
1 files changed, 8 insertions, 0 deletions
diff --git a/.functions b/.functions
index 79255f1..e78f855 100644
--- a/.functions
+++ b/.functions
@@ -303,3 +303,11 @@ function np() {
git push origin master && \
git push origin master --tags
}
+
+# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring
+# the `.git` directory, listing directories first. The output gets piped into
+# `less` with options to preserve color and line numbers, unless the output is
+# small enough for one screen.
+function tre() {
+ tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX
+}