toggle whale spotting from within broot
I often find myself wanting to switch to whale mode while navigating my directories with broot.
A bit similar to how the :toggle hidden functionality works.
Would there be a way to do that?
I tried defining the following verb:
{
invocation: whale
shortcut: wh
key: w
execution: "br -w"
}
, but it does not work.
Nevermind, just realized sort_by_size does it!
Doesn't do it wholly though. There's a lot of changes in the whale mode, like showing hidden and ignored files.
-w is handled like this:
if cli_args.whale_spotting {
self.show_hidden = true;
self.respect_git_ignore = false;
self.sort = Sort::Size;
self.show_sizes = true;
self.show_root_fs = true;
}
Most could be done with a composite verb but adding a lot of toggles doesn't work when part of the things are on and others are off.
If you want to change this question into a request for a clean toggle_whale_mode, it would be ok.
Yes please, would be great to have such a mode!
It is possible in broot to apply ANY command line options mid-session as a command starting with -, for example by hitting <space>-{Option}<ENTER>.
So
- to switch whale mode on:
<space>-w<ENTER> - to switch whale mode off:
<space>-W<ENTER>
With that being said, maybe it would be good to have something like toggle_whale for consistency with other options.
Thank you for the input @j-xella, I was not aware of this functionality. Is it documented somewhere? Looked on the website but didn't spot anything.
Thanks you @j-xella, I was not aware anymore of this functionality... I had totally forgotten it...
Is it documented somewhere? Looked on the website but didn't spot anything.
Looks like it should. I'll add it.