broot icon indicating copy to clipboard operation
broot copied to clipboard

toggle whale spotting from within broot

Open aris-mav opened this issue 4 weeks ago • 7 comments

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.

aris-mav avatar Dec 01 '25 10:12 aris-mav

Nevermind, just realized sort_by_size does it!

aris-mav avatar Dec 01 '25 10:12 aris-mav

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.

Canop avatar Dec 01 '25 10:12 Canop

Yes please, would be great to have such a mode!

aris-mav avatar Dec 01 '25 10:12 aris-mav

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.

j-xella avatar Dec 04 '25 12:12 j-xella

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.

aris-mav avatar Dec 04 '25 13:12 aris-mav

Thanks you @j-xella, I was not aware anymore of this functionality... I had totally forgotten it...

Canop avatar Dec 04 '25 13:12 Canop

Is it documented somewhere? Looked on the website but didn't spot anything.

Looks like it should. I'll add it.

Canop avatar Dec 04 '25 13:12 Canop