broot icon indicating copy to clipboard operation
broot copied to clipboard

Open broot with a default selected file/directory.

Open jdrupal-dev opened this issue 1 year ago • 5 comments

I am using broot as my file manager and file navigator in neovim. I would like to be able to have the current file preselected when I open broot in neovim.

Currently I achieve this with this command "broot -c ':select " .. vim.fn.expand("%:") .. "'" e.g. broot -c ':select some/dir'. This works fine when the directory or file is expanded in broot, but does not work for very nested directories or files.

Would it be possible to auto-expand the tree when passing some/very/long/and/nested/dir/file.txt to the :select command?

This would be very helpful as I would be able to navigate in the files that are close to the one that I am currently working with.

jdrupal-dev avatar Aug 23 '24 09:08 jdrupal-dev

Just to be sure: the reason you don't use broot some/very/long/and/nested/dir/file.txt is because you want to keep the current tree root ?

Canop avatar Aug 23 '24 09:08 Canop

Yes, I would still like to be able to search for files in the entire project.

jdrupal-dev avatar Aug 23 '24 10:08 jdrupal-dev

ok, noted.

Canop avatar Aug 23 '24 10:08 Canop

@jdrupal-dev Can you test https://github.com/Canop/broot/pull/937 ?

Canop avatar Aug 26 '24 15:08 Canop

@Canop Thank you for the quick reaction 🚀 Your PR seems to work flawlessly and just as anticipated, thank you!

jdrupal-dev avatar Aug 27 '24 05:08 jdrupal-dev