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

feat: support reacting to custom yazi DDS events #570

Merged
merged 2 commits into from
Nov 16, 2024
Merged

Conversation

mikavilpas
Copy link
Owner

note: DDS means "Data Distribution Service". It's a way for yazi to
communicate with neovim and other processes.

https://yazi-rs.github.io/docs/dds

Issue

Yazi is incredibly versatile and can be used for many different things.
However, it's too difficult to predict what the needs of every user will
be. Power users have no easy way to extend the behaviour of yazi.nvim
beyond the features that are built-in.

Solution

Allow users to subscribe to custom yazi DDS events. These events are
possibly not included in yazi by default, but can be published by yazi
plugins or by other applications using yazi's DDS system.

By default, all custom events are ignored. The user can specify which
events they want to listen to by setting a new forwarded_dds_events
(string[], default nil) config option.

When an event whose kind is included in this forwarded_dds_events list
is received, yazi.nvim will emit a neovim autocmd event with the name
YaziDDSCustom. The event will contain the type of the event and the
raw_data as a string. The user can then set up custom handlers for
these events in their neovim config.

Solves #547

> note: DDS means "Data Distribution Service". It's a way for yazi to
> communicate with neovim and other processes.
>
> https://yazi-rs.github.io/docs/dds

Issue
=====

Yazi is incredibly versatile and can be used for many different things.
However, it's too difficult to predict what the needs of every user will
be. Power users have no easy way to extend the behaviour of yazi.nvim
beyond the features that are built-in.

Solution
========

Allow users to subscribe to custom yazi DDS events. These events are
possibly not included in yazi by default, but can be published by yazi
plugins or by other applications using yazi's DDS system.

By default, all custom events are ignored. The user can specify which
events they want to listen to by setting a new `forwarded_dds_events`
(string[], default nil) config option.

When an event whose kind is included in this `forwarded_dds_events` list
is received, yazi.nvim will emit a neovim autocmd event with the name
`YaziDDSCustom`. The event will contain the `type` of the event and the
`raw_data` as a string. The user can then set up custom handlers for
these events in their neovim config.

Solves #547
@mikavilpas mikavilpas merged commit 882c200 into main Nov 16, 2024
16 checks passed
@mikavilpas mikavilpas deleted the custom-events branch November 16, 2024 19:38
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

Successfully merging this pull request may close these issues.

1 participant