Skip to content

Instantly share code, notes, and snippets.

@0atman
Last active August 29, 2015 14:07
Show Gist options
  • Save 0atman/4e432b84748ff5174dd4 to your computer and use it in GitHub Desktop.
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")
function chpwd() { │
emulate -L zsh │
tree --dirsfirst -L 1 `pwd` > ~/.current_tree │
}
@0atman
Copy link
Author

0atman commented Oct 22, 2014

console

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment