Last active
August 29, 2015 14:07
-
-
Save 0atman/4e432b84748ff5174dd4 to your computer and use it in GitHub Desktop.
A ZSH function to output the shell user's cwd tree to a file (with a view to printing it in an always-visible window, perhaps with "tail -n 20 .current_tree")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function chpwd() { │ | |
| emulate -L zsh │ | |
| tree --dirsfirst -L 1 `pwd` > ~/.current_tree │ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you've got zsh, just add source cwd_listener.sh to your .zshrc!
If you want to adapt this for BASH, line 3 is the portable line