aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
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
+}