Add new `tree` alias

ebb6eac5a2e0bb5766844b73cacf3fd28a72762b
Alexis Sellier committed ago 1 parent 380dbae3
.zshrc +12 -0
78 78
alias irc='weechat'
79 79
alias cloc='tokei'
80 80
alias shred='shred -uvz'
81 81
alias diskusage='ncdu'
82 82
alias calc=kalk
83 +
alias tree=tree-git-ignore
84 +
85 +
function tree-git-ignore {
86 +
  local ignored=$(git ls-files -ci --others --directory --exclude-standard)
87 +
  local ignored_filter=$(echo "$ignored" \
88 +
    | egrep -v "^#.*$|^[[:space:]]*$" \
89 +
    | sed 's~^/~~' \
90 +
    | sed 's~/$~~' \
91 +
    | tr "\\n" "|")
92 +
93 +
  /usr/bin/tree --prune -I ".git|${ignored_filter: : -1}" "$@"
94 +
}
83 95
84 96
export NNN_USE_EDITOR=1
85 97
86 98
#
87 99
# History