Canop / broot

A new way to see and navigate directory trees : https://dystroy.org/broot
MIT License
10.84k stars 236 forks source link

Your inputs for a cookbook #152

Open Canop opened 4 years ago

Canop commented 4 years ago

There seems to be the need for a list of recipes, including

Please share what, in your opinion, could be included in there.

Answer with either a recipe, part of a recipe, or a need for some specific one.

AndydeCleyre commented 9 months ago

I made it too easy to skip. I've now moved it up and made it hard to skip. Thanks!

Martin1887 commented 8 months ago

I have been using everything of the blog (and some additional verbs) flawlessly, thanks! However, the verb from #738 does not work, broot says it must be used as br. Any tip to solve this problem?

AndydeCleyre commented 8 months ago

@Martin1887

I use zsh-z so will try to get that going.

I think ideally we wouldn't exit the initial broot process, so that we can for example go back in history after jumping.

I can use an external to get a path result from zsh-z to the stdout of that external, but I don't know how to capture the external's stdout into a variable we can use in the same verb definition's internal or cmd entries.

@Canop What might make sense for setting a verb-usable variable from the result of an external process? Some variant of external? Or some substitution syntax like $()... or some more use of write_output with a new read_output, so it's like a scratch space that can be loaded into a variable? Or did I in fact entirely miss a better/existing approach?

Alfamari commented 2 months ago

Regardless of what hotkeys I'm using I always rebind my horizontal movement to :root_up and :root_down

{
    key: h
    execution: ":root_up"
}
{
    key: l
    execution: ":root_down"
}

Rebound ctrl-c to copy instead of quit (before I found out about leave_broot lol):

{
    key: ctrl-c
    cmd: ":copy_path;:quit"
}

Ability to invoke cd on a file without needing to select it's directory first:

{
    name: "Cd to file's parent"
    invocation: "cdp"
    external: "cd {parent}"
    leave_broot: true
    from_shell: true
}

Got this from someone else but it's really good. Let's you run arbitrary shell commands on the fly:

{
    invocation: "run {exec}"
    shortcut: r
    execution: "{exec} {file}"
    from_shell: true
}

Text line editing:

{
    key: ctrl-w
    execution: ":input_del_word_left"
}
{
    key: ctrl-u
    execution: ":input_clear"
}

Play with mpv:

{
    invocation: play
    execution: "mpv {file} --really-quiet"
    leave_broot: false
}

Save item to global variable to use repeated/advanced shell commands (powershell syntax). I've also edited the br.ps1 so that :print_path saves to a global variable. I use this one so, so much. And I don't think other terminal file managers can leverage this due to how they were designed.

{
    name: "Set-Variable"
    invocation: "sv"
    external: "$global:br = get-item {file}"
    leave_broot: true
    from_shell: true
}