News for hackers. Stuff that matters.
Re:Command line tools for productive programmers by SPBS on Thursday July 29, 2021 @12:46AM (#27992858)
> if the directory has many files or sub-directories, tree becomes much less helpful: you only see the last screen full of information as files scroll past you.

> broot solves this problem by being aware of the size of your terminal window and adapting its output to fit it.

What? You can just pipe `tree` into `less`. The solution isn't to download Yet Another Binary that does this specific thing and doesn't come installed on most platforms.

Re:Command line tools for productive programmers by indianboy42 on Thursday July 29, 2021 @01:11AM (#27992979)
Use broot as tree is not necessary of course `tree | less` works for that but as hinted in the article broot contains a lot more features. Fuzzy finding, preview, multiwindow copy/paste, renaming, directory navigation etc
Re:Command line tools for productive programmers by wruza on Thursday July 29, 2021 @01:26AM (#27993062)
Does it contain emacs? That would be nice.
Re:Command line tools for productive programmers by jcynix on Thursday July 29, 2021 @03:05AM (#27993691)
What's wrong with dired mode? Ok, you'll get each directory in its own buffer. But, thinking of that, it shouldn't be to hard to make dired mode recurse into subdirectories inside the same buffer. (And fold/unfold like orgmode does. ;-)
Re:Command line tools for productive programmers by natrys on Thursday July 29, 2021 @05:17AM (#27994450)
It's a single variable setting now:

https://www.manueluberti.eu/emacs/2021/07/14/dired/

Re:Command line tools for productive programmers by thom on Thursday July 29, 2021 @03:22AM (#27993807)
dired-subtree does this, albeit on demand, not eagerly descending into subdirectories. dired-hacks more generally has lots of good stuff like filtering etc.
Re:Command line tools for productive programmers by kitd on Thursday July 29, 2021 @02:25AM (#27993450)
There's a broot alternative called lf that opens files in $EDITOR

https://github.com/gokcehan/lf

Re:Command line tools for productive programmers by awestroke on Thursday July 29, 2021 @01:37AM (#27993142)
What would be nice about that?
Re:Command line tools for productive programmers by wruza on Thursday July 29, 2021 @02:14AM (#27993390)
You could edit files that you just found and renamed. And when you edit files, then there is RCS integration and… linting, spellcheck, printing, you name it. It’s just a unix way. Is broot ISO/IEC 9945:2009 compliant?

/s

Re:Command line tools for productive programmers by jkrubin on Thursday July 29, 2021 @01:59AM (#27993307)
That it would contain emacs
Re:Command line tools for productive programmers by tempodox on Thursday July 29, 2021 @10:15AM (#27996814)
Can broot render on a light background? I haven't found an option for that. If it could, I'd use it.
Re:Command line tools for productive programmers by dystroy on Friday August 06, 2021 @02:09AM (#28083845)
Re:Command line tools for productive programmers by arp242 on Thursday July 29, 2021 @07:39AM (#27995294)
I generally just use zsh globbing for this by the way:

  ls **(.)
To list all files, recursively, or some variation thereof depending what I want: *(/) for directories, *() for executable files, etc. With a global alias it can be piped to less with LL: "ls *(.) LL". You can actually do a lot of stuff with it, and is basically good replacement for find, except with less typing. The syntax looks a bit daunting at first, but especially for basic stuff it's not that hard (e.g. / and is the same as what ls -F uses).

I wish there was a better pager than less though, but haven't really found it (and no, Rust project X with 115 different colours that don't even work on a light background and/or "fuzzy" matching that never gives me what I want is not it).

Re:Command line tools for productive programmers by lamontcg on Thursday July 29, 2021 @12:00PM (#27998007)
Well if we wanna be grumpy this morning... I don't understand why people don't learn how to use `find` properly. And just doing simple things correctly like the `-print0` integration with `xargs -0` to be able to safely send a list of files into rm even if they've got spaces or whatever. I never have much use for `tree` unless I'm trying to take a screenshot and make it look kind of nice.
Re:Command line tools for productive programmers by lobocinza on Thursday July 29, 2021 @09:07PM (#28003372)
find and grep are mandatory tools of the Linux toolbox but I use fd and ripgrep most of the time.
Re:Command line tools for productive programmers by dystroy on Friday August 06, 2021 @02:15AM (#28083877)
[broot author here]

Have you ever tried to pipe `tree` into `less` in a real code directory, with directories containing thousands of files ? That solves no problem.

The idea of broot isn't just to "be aware of the size of your terminal": its view is BFS based to show you a useful overview.

See explanation here: https://dystroy.org/broot/#get-an-overview-of-a-directory-ev...

Re:Command line tools for productive programmers by deepfriedrice on Thursday July 29, 2021 @01:10AM (#27992968)
What's wrong with solving problems the unix guys already solved decades ago, and doing so less elegantly?
Re:Command line tools for productive programmers by thefz on Thursday July 29, 2021 @03:54AM (#27993991)
Exactly, this is the opposite of the unix way of doing things. Do only one thing and well, be nimble.
Re:Command line tools for productive programmers by capableweb on Thursday July 29, 2021 @04:35AM (#27994218)
> this is the opposite of the unix way of doing things

Which makes sense, this is an article for people on Apple hardware (judging by the installation instructions), so no interest in keeping things "the unix way of doing things"

Re:Command line tools for productive programmers by BoxOfRain on Thursday July 29, 2021 @05:29AM (#27994515)
I have no dog in this fight (I use both Linux and macOS as daily drivers) but it could be argued that macOS has more of a claim to be Unix than Linux since the foundation of macOS comes from NeXTSTEP and FreeBSD whose codebases both ultimately descend from the original Bell Labs Unix, whereas Linux started life completely independently.

I'd argue that Linux is more Unixy than macOS in terms of philosophy though, I remember reading that Dennis Ritchie considered Linux as much of a Unix as the other offerings on the market at the time which were the BSDs and commercial Unix variants; his opinion is obviously worth thousands of mine!

Re:Command line tools for productive programmers by dec0dedab0de on Thursday July 29, 2021 @07:39AM (#27995290)
OSx is also Unix certified by the open group, along with hp-ux and aix.

https://www.opengroup.org/openbrand/register/

Re:Command line tools for productive programmers by joshuaissac on Thursday July 29, 2021 @07:44AM (#27995323)
There is a Linux distro in that list, too: Huawei's EulerOS, based on CentOS.