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: can use ya emit for more accurate <tab> to file (opt-in) #604

Merged
merged 3 commits into from
Dec 8, 2024

Conversation

mikavilpas
Copy link
Owner

To celebrate the release of yazi 0.4.0, you can now opt in to improve the accuracy of <tab> to a file. Read below for more information on what this is and how you can opt into using it.

https://github.com/sxyazi/yazi/releases/tag/v0.4.0

Background

When yazi is open, and there are multiple splits open in neovim, it's currently possible to press <tab> to cycle through the open buffers. When you press <tab>, yazi will change its current directory and focus the file that's next in the list of open splits (vertical or horizontal split).

Issue

When pressing <tab>, yazi was only able to change its current directory to the same directory the next split is in. If there were multiple files in that directory, the first file would be focused. This is not necessarily the file that's next in the list of open splits, which can be disorienting.

Solution

If you have yazi 0.4.0 or later, you can now set the following in your yazi.nvim configuration:

---@type YaziConfig
{
  -- ... lots of other settings, see the README
  future_features = {
    -- Whether to use `ya emit reveal` to reveal files in the file manager.
    -- This requires yazi 0.4.0 but will likely be the default in the
    -- future.
    ya_emit_reveal = true,
  },
}

To celebrate the release of yazi 0.4.0, you can now opt in to improve
the accuracy of `<tab>` to a file. Read below for more information on
what this is and how you can opt into using it.

https://github.com/sxyazi/yazi/releases/tag/v0.4.0

Background
==========

When yazi is open, and there are multiple splits open in neovim, it's
currently possible to press `<tab>` to cycle through the open buffers.
When you press `<tab>`, yazi will change its current directory and focus
the file that's next in the list of open splits (vertical or horizontal
split).

Issue
=====

When pressing `<tab>`, yazi was only able to change its current
directory to the same directory the next split is in. If there were
multiple files in that directory, the first file would be focused. This
is not necessarily the file that's next in the list of open splits,
which can be disorienting.

Solution
========

If you have yazi 0.4.0 or later, you can now set the following in your
yazi.nvim configuration:

```lua
---@type YaziConfig
{
  -- ... lots of other settings, see the README
  future_features = {
    -- Whether to use `ya emit reveal` to reveal files in the file manager.
    -- This requires yazi 0.4.0 but will likely be the default in the
    -- future.
    ya_emit_reveal = true,
  },
}
```
@mikavilpas mikavilpas enabled auto-merge (squash) December 8, 2024 15:40
@mikavilpas mikavilpas merged commit b81e03c into main Dec 8, 2024
16 checks passed
@mikavilpas mikavilpas deleted the reveal branch December 8, 2024 15:53
mikavilpas added a commit to mikavilpas/dotfiles that referenced this pull request Dec 8, 2024
This was implemented in
mikavilpas/yazi.nvim#604

and is currently opt-in.
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