techniques / tree-copy
tree-copy
Generates a visual ASCII directory tree with file icons, respecting .gitignore/.ignore rules, and copies output to clipboard.
utilfile
Paste this in your terminal. It saves the command as tree-copy.
Windows
cwm save -t util -t file -d "Generates visual ASCII directory tree to clipboard" tree-copy "& { `$root = (Get-Location).Path; `$rules = @('*.git*', '.git\*'); foreach (`$f in @('.gitignore', '.ignore')) { `$p = Join-Path `$root `$f; if (Test-Path `$p) { `$rules += Get-Content `$p | Where-Object { `$_ -match '\S' -and !`$_.StartsWith('#') } | ForEach-Object { `$clean = `$_ -replace '^/','' -replace '/+