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

Keeping Yazi open in the background / no delay when opening #593

Open
Oneechan69 opened this issue Dec 2, 2024 · 2 comments
Open

Keeping Yazi open in the background / no delay when opening #593

Oneechan69 opened this issue Dec 2, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Oneechan69
Copy link

While nvim runs fast and fine, I always have a small delay when I do yazi cwd.

@mikavilpas
Copy link
Owner

mikavilpas commented Dec 2, 2024

Thanks for the idea! Right now this is not possible. However, I have been thinking about adding this feature for some months now.

I should migrate the floating window implementation to use https://github.com/folke/snacks.nvim which is popular and should provide this out of the box. Naturally, only the necessary features will be loaded to keep everything as fast as possible.

As a proof-of-concept for this idea, I actually already built a fast lazygit integration that uses the same approach in https://github.com/mikavilpas/tsugit.nvim. It runs lazygit in the background and gets rid of the opening delay, although I'm probably the only user. Anyway, 100% of the users agree that this approach works really well 😄

Let's keep this issue open to track the progress!

Many other things are also required for this to function properly:

  • use feat: new ya emit and ya emit-to subcommands to emit commands to a specified instance for execution sxyazi/yazi#1979 to make the background yazi track the current buffer. If the current buffer changes, yazi should highlight the new buffer
  • for historical reasons, yazi events for "file renamed/moved/deleted" were only reacted to when yazi was closed. These days we can use ya to react to these events live
  • snacks.nvim also provides a way to close a buffer without closing its window - this was one of the reasons I have not implemented reacting to events live yet. The default neovim implementation is to also close the window, which is very annoying.
  • users that use lazy.nvim probably need to do nothing to have access to snacks.nvim when this is released (I will add it as a lazy.nvim dependency). I think the same goes for users of rocks.nvim (luarocks based package management). Users that don't use a package manager should get notified that they will need it as a dependency.
  • Because this requires the nightly version of yazi, it will have to be opt-in at first
  • Should have some way of force quitting the background yazi, in case there are some unforeseen issues

@mikavilpas mikavilpas self-assigned this Dec 2, 2024
@mikavilpas mikavilpas added the enhancement New feature or request label Dec 2, 2024
Copy link
Contributor

github-actions bot commented Jan 2, 2025

This issue is stale because it has been open for 30 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants