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 bulk renaming files in nightly yazi (opt-in) #152

Merged
merged 4 commits into from
Jul 10, 2024

Conversation

mikavilpas
Copy link
Owner

@mikavilpas mikavilpas commented Jul 2, 2024

This change is optional, and by default is not enabled for users.

yazi-bulk-rename.mov

To opt in, you need to do the following:

  • install the latest yazi from source
  • install the latest ya from source. ya is the standalone command
    line tool for yazi. You can read
    Introduce a standalone CLI program sxyazi/yazi#914 for more information.
  • set the new config option use_ya_for_events_reading = true (it's
    false by default for now)
  • run :checkhealth yazi to verify that ya is found and that the
    healthcheck passes

Bulk renaming in yazi is done by

  • selecting multiple files in yazi
  • pressing r to rename the files. This will open $EDITOR, typically
    Neovim, inside yazi.
  • The nested Neovim will display the selected file names, one per line.
    The user can then edit the names as needed.
  • save and quit the nested Neovim instance. This will rename the files
    in yazi.

https://yazi-rs.github.io/docs/configuration/keymap/#manager.rename


Technical details for developers:

  • in the future, once the next release of yazi is out, yazi.nvim may
    automatically use ya for reading events. This would then be the
    default behavior. ya may enable more advanced features in the
    future.
  • yazi is now built from source in continuous integration
  • the integration testing system, although perhaps innovative, is still
    taking shape. I believe in time it will stabilize, but I don't want to
    cement the design too much until the best structure becomes evident in
    time.

Closes #135, closes #130

@mikavilpas
Copy link
Owner Author

Looks like the tests fail. I think it might be because the integration tests now require the bleeding edge version of yazi and ya, and the version installed might be too old.

@mikavilpas mikavilpas force-pushed the read-events-with-ya-sub branch 5 times, most recently from 95fbb19 to 2d140b3 Compare July 6, 2024 07:54
@mikavilpas
Copy link
Owner Author

On this branch right now, bulk renaming works nicely when the bleeding edge yazi and ya are used. Next, I need to make this opt-in instead of a breaking change, and make sure both ways are tested.

I want to have a transition period from using the current stable yazi to requiring the next version of yazi with ya available, as that will be needed for stuff that I have planned for the future. During this transition period, both approaches need to be supported and tested.

@mikavilpas mikavilpas force-pushed the read-events-with-ya-sub branch 5 times, most recently from 2546e7b to 5478a3c Compare July 7, 2024 16:12
This change is optional, and by default is not enabled for users.

To opt in, you need to do the following:
- install the latest `yazi` from source
- install the latest `ya` from source. `ya` is the standalone command
  line tool for yazi. You can read
  <sxyazi/yazi#914> for more information.
- set the new config option `use_ya_for_events_reading = true` (it's
  `false` by default for now)
- run `:checkhealth yazi` to verify that `ya` is found and that the
  healthcheck passes

Bulk renaming in yazi is done by
- selecting multiple files in yazi
- pressing `r` to rename the files. This will open `$EDITOR`, typically
  Neovim, inside yazi.
- The nested Neovim will display the selected file names, one per line.
  The user can then edit the names as needed.
- save and quit the nested Neovim instance. This will rename the files
  in yazi.

<https://yazi-rs.github.io/docs/configuration/keymap/#manager.rename>

---

Technical details for developers:

- in the future, once the next release of yazi is out, yazi.nvim may
  automatically use `ya` for reading events. This would then be the
  default behavior. `ya` may enable more advanced features in the
  future.
- `yazi` is now built from source in continuous integration
- the integration testing system, although perhaps innovative, is still
  taking shape. I believe in time it will stabilize, but I don't want to
  cement the design too much until the best structure becomes evident in
  time.

Closes #135
@mikavilpas mikavilpas changed the title WIP: feat!: support bulk renaming files in yazi feat: support bulk renaming files in nightly yazi (opt-in) Jul 7, 2024
@mikavilpas
Copy link
Owner Author

This is now ready to be released! I added a video demo to the original post.

I will merge this in a couple of days.

@mikavilpas mikavilpas merged commit 8bd164d into master Jul 10, 2024
13 checks passed
@mikavilpas mikavilpas deleted the read-events-with-ya-sub branch July 10, 2024 14:07
mikavilpas added a commit to mikavilpas/dotfiles that referenced this pull request Jul 10, 2024
mikavilpas added a commit that referenced this pull request Jul 14, 2024
Hover highlighting is now enabled by default
===
This works with the latest yazi when `use_ya_for_events_reading = true`
is specified. To learn more about enabling this, see
<#152>

This will be the default behaviour when yazi 0.3 is released.

Hover highlighting colors no longer require manual configuration
===

This change adds default colors for the hover highlighting feature. The
logic supports both light and dark colorschemes:
- for dark colorschemes, the hovered buffer will be lighter in color
- for light colorschemes, it will be darker

The logic is borrowed from the `bufferline.nvim` plugin, which has a lot
of users and is well-maintained. This also adds a dependency to
bufferline.nvim, but as an optimization only its color utility functions
are used as late as possible, and even they are only used when the user
hasn't specified a custom highlight color.

BREAKING CHANGE: The optional `hovered_buffer_background` key in the
`YaziConfigHighlightGroups` has been renamed to `hovered_buffer`. This
change was made to better reflect the purpose of the key.

To migrate, run this 🙂

```vim
:%s/hovered_buffer_background/hovered_buffer/gc
```
mikavilpas added a commit that referenced this pull request Jul 14, 2024
* feat!: add default colors for hover highlighting

Hover highlighting is now enabled by default
===
This works with the latest yazi when `use_ya_for_events_reading = true`
is specified. To learn more about enabling this, see
<#152>

This will be the default behaviour when yazi 0.3 is released.

Hover highlighting colors no longer require manual configuration
===

This change adds default colors for the hover highlighting feature. The
logic supports both light and dark colorschemes:
- for dark colorschemes, the hovered buffer will be lighter in color
- for light colorschemes, it will be darker

The logic is borrowed from the `bufferline.nvim` plugin, which has a lot
of users and is well-maintained. This also adds a dependency to
bufferline.nvim, but as an optimization only its color utility functions
are used as late as possible, and even they are only used when the user
hasn't specified a custom highlight color.

BREAKING CHANGE: The optional `hovered_buffer_background` key in the
`YaziConfigHighlightGroups` has been renamed to `hovered_buffer`. This
change was made to better reflect the purpose of the key.

To migrate, run this 🙂

```vim
:%s/hovered_buffer_background/hovered_buffer/gc
```
mikavilpas added a commit to mikavilpas/dotfiles that referenced this pull request Jul 15, 2024
Squashed commit of the following:

commit f57e7cb
Author: Mika Vilpas <[email protected]>
Date:   Mon Jul 15 09:00:21 2024 +0300

    fix(nvim): which-key v3 prevents lazygit from pressing esc

commit c9da0ed
Author: Mika Vilpas <[email protected]>
Date:   Mon Jul 15 08:59:41 2024 +0300

    chore(nvim): update packages

commit c8437e8
Author: Mika Vilpas <[email protected]>
Date:   Sun Jul 14 12:53:36 2024 +0300

    chore(nvim): update packages

commit 5350ee6
Author: Mika Vilpas <[email protected]>
Date:   Sun Jul 14 09:55:03 2024 +0300

    chore(nvim): update packages

commit dcd1eef
Author: Mika Vilpas <[email protected]>
Date:   Sat Jul 13 19:59:23 2024 +0300

    fix(nvim): roll back which-key due to esc not working in terminal

commit d35f89b
Author: Mika Vilpas <[email protected]>
Date:   Sat Jul 13 19:46:00 2024 +0300

    chore(nvim): disable typos lsp log

commit 544e901
Author: Mika Vilpas <[email protected]>
Date:   Sat Jul 13 19:45:34 2024 +0300

    fix(nvim): annoying lazyvim keymap prevents using esc in terminal mode

commit 5feca89
Author: Mika Vilpas <[email protected]>
Date:   Sat Jul 13 17:58:20 2024 +0300

    chore(nvim): update packages

commit db79482
Author: Mika Vilpas <[email protected]>
Date:   Fri Jul 12 19:59:05 2024 +0300

    chore(nvim): update packages

commit b0516e8
Author: Mika Vilpas <[email protected]>
Date:   Thu Jul 11 21:36:36 2024 +0300

    feat(nvim): opt into testing yazi hover highlight feature

    mikavilpas/yazi.nvim#180

commit 1731512
Author: Mika Vilpas <[email protected]>
Date:   Thu Jul 11 08:11:28 2024 +0300

    chore(nvim): update packages

commit 5c0c252
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 10 18:38:46 2024 +0300

    chore(nvim): update packages

commit 10f7b04
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 10 17:27:35 2024 +0300

    chore(nvim): update packages

commit 7ae1666
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 10 17:27:07 2024 +0300

    feat(nvim): opt into yazi.nvim event reading with `ya`

    mikavilpas/yazi.nvim#152

commit 61ed767
Author: Mika Vilpas <[email protected]>
Date:   Sun Jul 7 20:04:20 2024 +0300

    refactor(yazi): make shell commands --interactive

    This seems to be a new recommendation in the upcoming version of Yazi.

commit a7600f1
Author: Mika Vilpas <[email protected]>
Date:   Sun Jul 7 19:59:29 2024 +0300

    chore(nvim): update packages

commit 5b2a94a
Author: Mika Vilpas <[email protected]>
Date:   Sat Jul 6 09:30:17 2024 +0300

    chore(nvim): update packages

commit e7152b9
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 3 17:36:01 2024 +0300

    chore(nvim): update packages

commit 9b5477e
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 3 10:03:46 2024 +0300

    fix(nvim): allow yazi.nvim to open a nested nvim

    Having flatten.nvim enabled while using yazi.nvim causes issues with
    bulk renaming. This is because flatten.nvim "flatten" the nested nvim
    session, causing the bulk renaming file to be opened behind yazi.nvim's
    floating terminal.

    Work around this simply by disabling flatten.nvim when the YAZI_ID
    environment variable is set.

commit 254622a
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 3 10:03:35 2024 +0300

    refactor(nvim): remove unused variable

commit cb4e90d
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 3 10:03:24 2024 +0300

    refactor(nvim): add typing for colors.lua

commit 1e69cf1
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 3 10:00:44 2024 +0300

    refactor(nvim): yazi.nvim no longer needs plenary dep to be given

    It's now handled internally in yazi.nvim

commit 0393bca
Author: Mika Vilpas <[email protected]>
Date:   Wed Jul 3 09:59:50 2024 +0300

    chore(nvim): update packages

commit c1bc48d
Author: Mika Vilpas <[email protected]>
Date:   Sat Jun 29 14:01:41 2024 +0300

    chore(nvim): update packages

commit 1e3d41f
Author: Mika Vilpas <[email protected]>
Date:   Sat Jun 29 14:01:16 2024 +0300

    fix(nvim): lazyvim would color directories pink

    I want them gray!

commit ade9046
Author: Mika Vilpas <[email protected]>
Date:   Sat Jun 29 13:59:53 2024 +0300

    fix(starship): change the clock symbol to a non-removed one

    The new one is `nf-md-clock_time_four_outline`

    https://www.nerdfonts.com/cheat-sheet

    The old one was `nf-mdi-clock`, which seems to have been removed.

    It did not show up in other terminals, only wezterm.

commit 7d761b4
Author: Mika Vilpas <[email protected]>
Date:   Thu Jun 27 20:17:45 2024 +0300

    chore(nvim): update packages

commit 3afca63
Author: Mika Vilpas <[email protected]>
Date:   Thu Jun 27 13:30:27 2024 +0300

    refactor(zsh): use "docker compose" instead of "docker-compose"

commit 63d7304
Author: Mika Vilpas <[email protected]>
Date:   Wed Jun 26 21:26:14 2024 +0300

    chore(nvim): update packages

commit ef55d6c
Author: Mika Vilpas <[email protected]>
Date:   Wed Jun 26 20:46:14 2024 +0300

    chore(nvim): update packages

commit fe49dae
Author: Mika Vilpas <[email protected]>
Date:   Wed Jun 26 18:26:35 2024 +0300

    chore(nvim): update packages

commit b066dfa
Author: Mika Vilpas <[email protected]>
Date:   Tue Jun 25 08:05:21 2024 +0300

    chore(nvim): update packages

commit 1799696
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 24 20:41:07 2024 +0300

    chore(nvim): update packages

commit 3cc727f
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 24 20:40:58 2024 +0300

    feat(zsh): watchexec provides timings for commands

commit 6aa86d6
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 24 20:40:46 2024 +0300

    feat(nvim): github copilot can suggest commit messages based on diff

    This way the diff of the commit-to-be is easily visible to copilot, so
    it has much more context to provide better suggestions with

commit 75e070c
Author: Mika Vilpas <[email protected]>
Date:   Sun Jun 23 11:21:30 2024 +0300

    chore(nvim): update packages

commit bf98284
Author: Mika Vilpas <[email protected]>
Date:   Sun Jun 23 11:18:06 2024 +0300

    refactor(nvim): expose linking to a relative file to plugins

commit df54238
Author: Mika Vilpas <[email protected]>
Date:   Sat Jun 22 08:29:36 2024 +0300

    chore(nvim): update packages

commit 11d4ccb
Author: Mika Vilpas <[email protected]>
Date:   Thu Jun 20 19:01:08 2024 +0300

    chore(nvim): update packages

commit 7cb4155
Author: Mika Vilpas <[email protected]>
Date:   Wed Jun 19 13:46:57 2024 +0300

    fix(nvim): try letting lsps know lazygit might have modified files

commit 56650e8
Author: Mika Vilpas <[email protected]>
Date:   Wed Jun 19 13:46:38 2024 +0300

    chore(nvim): update packages

commit ce05f23
Author: Mika Vilpas <[email protected]>
Date:   Wed Jun 19 13:46:16 2024 +0300

    chore(nvim): update packages

commit d961add
Author: Mika Vilpas <[email protected]>
Date:   Tue Jun 18 21:54:14 2024 +0300

    fix(nvim): incorrect notify level

commit 3b5a92a
Author: Mika Vilpas <[email protected]>
Date:   Tue Jun 18 14:13:30 2024 +0300

    chore(nvim): update packages

commit c7c1f11
Author: Mika Vilpas <[email protected]>
Date:   Tue Jun 18 14:13:24 2024 +0300

    fix(nvim): warning for deprecated gitsigns opt

commit 58cd290
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 17 18:03:39 2024 +0300

    refactor(nvim): lsp_signature has comments

commit 8b4b9d3
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 17 18:03:16 2024 +0300

    chore(nvim): update packages

commit 900df4a
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 17 18:02:55 2024 +0300

    feat(zsh): global aliases for automatically highlighting help messages

commit 1733f04
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 17 14:50:01 2024 +0300

    chore(aerospace): remove deprecated default configs

commit ed39935
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 17 14:49:47 2024 +0300

    feat(nvim): reenable luasnip, the build in snippets are annoying

commit 086f7ee
Author: Mika Vilpas <[email protected]>
Date:   Mon Jun 17 14:49:28 2024 +0300

    chore(nvim): update packages

commit 3921676
Author: Mika Vilpas <[email protected]>
Date:   Sun Jun 16 09:31:19 2024 +0300

    chore(nvim): update packages

commit 52033e5
Author: Mika Vilpas <[email protected]>
Date:   Sat Jun 15 18:45:15 2024 +0300

    chore(nvim): update packages

commit 98e2c11
Author: Mika Vilpas <[email protected]>
Date:   Fri Jun 14 11:16:22 2024 +0300

    chore(nvim): update packages

commit d6cc36b
Author: Mika Vilpas <[email protected]>
Date:   Fri Jun 14 11:16:20 2024 +0300

    feat(zsh): add luarocks to PATH
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.

Bulk renaming is broken Support systems with nushell as the default shell
1 participant