Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support broot? #5

Closed
IndianBoy42 opened this issue Nov 9, 2021 · 5 comments
Closed

Support broot? #5

IndianBoy42 opened this issue Nov 9, 2021 · 5 comments

Comments

@IndianBoy42
Copy link

https://github.com/Canop/broot

Would it be possible to add support for broot in this plugin?

@is0n
Copy link
Owner

is0n commented Nov 9, 2021

Would it be possible to add support for broot in this plugin?

I'm not sure as I've never used broot before. How might you suggest I accomplish this?

@IndianBoy42
Copy link
Author

So actually I think I could implement this if createWin and setMappings were public.

broot has --outcmd which is similar to what you use with the other file managers, although it outputs a whole command, not just the filename of the selected file/dir. So I would need a custom on_close to parse that somehow

@is0n
Copy link
Owner

is0n commented Nov 10, 2021

So actually I think I could implement this if createWin and setMappings were public

The most recent commit should have done this.

For future reference, you could also clone the repo and include it in your list of plugins. The following should work assuming you use packer...

$ git clone https://github.com/is0n/fm-nvim ~/fm-nvim
use {'~/fm-nvim'}

With that, you wouldn't need to have those functions be public.

Hope this helps! 😄

@is0n
Copy link
Owner

is0n commented Nov 13, 2021

After some tinkering around, I've found one possible way of supporting broot.

It's by using...

$ broot --out /tmp/fm-nvim

Using the following will use /tmp/fm-nvim as a temp file. The only problem is that if you now want to open a file, you have to select it and do :print_path in broot. Do you know how we can map Return/Enter to :print_path in broot? I imagine it's by using --conf.

The following resources may help...

If you would like to try it out, use the following in neovim...

:lua require('fm-nvim').createWin("broot --out /tmp/fm-nvim")

and then type...

:print_path

in broot once you have selected a file.

@is0n
Copy link
Owner

is0n commented Nov 14, 2021

Latest commit fixes the issue. LMK if there's anything that's missing or that is buggy :)

@is0n is0n closed this as completed Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants