Canop / broot

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

Option to always open editor relative to directory where i start `broot` #864

Closed l1onsun closed 3 months ago

l1onsun commented 3 months ago

I use broot with helix on my codebase. I start br at the project root and then looking for the file i need.

Sometimes, the file is located deep in subdirectories, so it i first enter subdirs and then open the required file. However, in this case helix opens relative to the entered subdir rather than project root, which is very inconvenient (for example lsp doesn't see whole project, so in need change helix current directory and restart lsp).

I know i can continue searching file, without entering subdirs, but it is not always convenient for me. Is there any way to avoid changing root dir on enter?

Canop commented 3 months ago

Would that be satisfied with https://github.com/Canop/broot/issues/394 ?

l1onsun commented 3 months ago

Yes probably it would!

Are there any plans for when this will be implemented? Or i can probably try to implement this, if it is not started.

Canop commented 3 months ago

I'd rather do it, I have specific projects for that. It was quite low on my TODO list because nobody was looking much interested but I'll put it near the top.

l1onsun commented 3 months ago

Great, thank you! 👍

Canop commented 3 months ago

@l1onsun Thinking about your problem again, wouldn't it be solved with this config in verbs.hjson ?

    {
        invocation: edit
        key: enter
        shortcut: e
        execution: "hx {file}:{line}"
        apply_to: text_file
        leave_broot: false
        working_dir: "{git-root}"
    }
l1onsun commented 3 months ago

Yes, it solves it 🎉 Thank you very much!!