From a13e6694d54b1872235c174c507fa1f7d274ff21 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Tue, 18 Jun 2019 17:54:41 +0000 Subject: [PATCH] Improve tree aliases - Remove duplication of options - Add common ignore rules --- dotfiles/.bashrc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 96f5809..befe0f6 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -139,11 +139,17 @@ bashrc_customize_aliases() { alias myip="dig +short myip.opendns.com @resolver1.opendns.com" alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' - alias tree="tree -F --dirsfirst" + alias tree="bashrc_tree" + alias ltree="bashrc_paged_tree" } -ltree() { - tree -C -F --dirsfirst "$@" | less -R +bashrc_tree() { + # The 'tree' alias is not available here, so this calls the actual program. + tree -F --dirsfirst -I '.git|Spotlight-V100|.fseventsd' "$@" +} + +bashrc_paged_tree() { + bashrc_tree -C "$@" | less -R } # Send an OSC (Operating System Commmand) to the terminal.