[go: up one dir, main page]

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

Migrating to Yazi v0.3.0 #1046

Closed
sxyazi opened this issue May 16, 2024 · 9 comments
Closed

Migrating to Yazi v0.3.0 #1046

sxyazi opened this issue May 16, 2024 · 9 comments

Comments

@sxyazi
Copy link
Owner
sxyazi commented May 16, 2024

TOC

Eliminated the exec property

Since Yazi v0.2.4, exec has been deprecated and replaced with a new run property and some compatibility code has been written to ensure users can transition smoothly.

In Yazi v0.3, these compatibility codes will be removed, meaning exec will be completely eliminated.

Please replace all instances of exec = ... with run = ... in your yazi.toml, keymap.toml, and theme.toml files if any, for example:

# keymap.toml
- { on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" }
+ { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" }

Eliminated the jump command

In Yazi v0.2.5, the jump command has been deprecated, and zoxide and fzf have been re-implemented as built-in plugins to enhance their functionality and provide better flexibility (See #865 for details).

In Yazi v0.3, the compatibility code of jump command will be deleted. Please replace them in your keymap.toml if any:

# keymap.toml
- { on = [ "z" ], run = "jump zoxide" },
+ { on = [ "z" ], run = "plugin zoxide" },
# keymap.toml
- { on = [ "Z" ], run = "jump fzf" },
+ { on = [ "Z" ], run = "plugin fzf" },

Removed the mime plugin from preloaders

Yazi v0.3 introduced a fetcher to simplify preloader design, and reclassified the mime plugin as part of the fetcher.

If you copied the entire preloaders before, please remove it from the list:

# yazi.toml
[plugin]
preloaders = [
-  { name = "*", cond = "!mime", run = "mime", prio = "high" }

Changed the behavior of the sort command's --reverse and --dir-first options

If you use a custom configuration and have overridden the , key series, please update them to the latest (See the sort docs for details):

{ on = [ ",", "m" ], run = "sort modified --reverse=no", desc = "Sort by modified time" },
{ on = [ ",", "M" ], run = "sort modified --reverse", desc = "Sort by modified time (reverse)" },
{ on = [ ",", "c" ], run = "sort created --reverse=no", desc = "Sort by created time" },
{ on = [ ",", "C" ], run = "sort created --reverse", desc = "Sort by created time (reverse)" },
{ on = [ ",", "e" ], run = "sort extension --reverse=no", desc = "Sort by extension" },
{ on = [ ",", "E" ], run = "sort extension --reverse", desc = "Sort by extension (reverse)" },
{ on = [ ",", "a" ], run = "sort alphabetical --reverse=no", desc = "Sort alphabetically" },
{ on = [ ",", "A" ], run = "sort alphabetical --reverse", desc = "Sort alphabetically (reverse)" },
{ on = [ ",", "n" ], run = "sort natural --reverse=no", desc = "Sort naturally" },
{ on = [ ",", "N" ], run = "sort natural --reverse", desc = "Sort naturally (reverse)" },
{ on = [ ",", "s" ], run = "sort size --reverse=no", desc = "Sort by size" },
{ on = [ ",", "S" ], run = "sort size --reverse", desc = "Sort by size (reverse)" },

The reason for this change

Before Yazi v0.3, the sort command was stateless. It didn’t consider the current sorting state of the directory. For example, if the directory was in reverse order, using sort new-ordering would lose that setting, and you’d have to use sort new-ordering --reverse to keep it.

If the directory had both --reverse and --dir-first enabled, you’d have to use sort new-ordering --reverse --dir-first, which was cumbersome. Yazi v0.3 introduced the sort --translit option, exacerbating this issue.

Therefore, in Yazi v0.3, the behavior was changed: the new sort command respects the previous directory sorting state. If --reverse isn’t passed, it won’t change the state, and --reverse/--dir-first now also supports --reverse=no to explicitly cancel it.

Used Ctrl-c instead of Ctrl-q as the universal close key for all components

Ctrl-c is more in line with conventions, and it's closer to Ctrl, which makes it more convenient to press. See #763 (comment) and #779 (comment) for more details.

This is a change in user behavior, so it's listed as a breaking change here. For users who copy the entire keymap.toml configuration file or use a custom key, they will not be affected.

Used K and J for the seek command

seek -5 has been changed from <A-k> to K, and seek 5 has been changed from <A-j> to J.

This is because scrolling the preview pane is a common operation, but some terminals do not support Alt key combinations or have them disabled by default. On macOS, there's no Alt key, only Option, and some terminals require additional settings to map Option to Alt (like the macos_option_as_alt option in kitty).

arrow -5 and arrow 5 have been also removed, they were previously bound to K and J and initially added to satisfy my own navigation needs before the relative-motions.yazi plugin existed. Since then, I've realized that using a fixed movement of 5 lines is quite subjective and many users don't use it at all.

Used <S-Enter> instead of <C-Enter> as the alternative key for interactive open

Previously, <C-Enter> was used as an alternative key for interactive open, in Yazi v0.3, changing it to <S-Enter> aligns with the behavior of o/O - o for direct file opening, O (Shift-o) for interactive file opening.

This change makes the behavior more intuitive and reduces additional cognitive burden. This is a change in user behavior, so it's listed as a breaking change here.

Redesigned icons

See #1086 for details.

Renamed the shell wrapper to yy, in favor of the new Ya CLI

This is a change in user behavior, so it's listed as a breaking change here. See #914 for details.

For users who do not need the new CLI program, they will not be affected since shell function takes precedence over binary programs.

@sxyazi sxyazi added feature New feature request and removed feature New feature request labels May 16, 2024
@mikavilpas

This comment was marked as off-topic.

mikavilpas added a commit to mikavilpas/dotfiles that referenced this issue May 19, 2024
@sxyazi

This comment was marked as off-topic.

@sxyazi
Copy link
Owner Author
sxyazi commented May 30, 2024

Lua API breaking changes in Yazi v0.3

success and code are now properties instead of methods of Status

local status = Command("ls"):spawn():wait()
- ya.err("success:", status:success(), "code:", status:code())
+ ya.err("success:", status.success, "code:", status.code)

Renamed is_block_device, is_char_device, and is_socket of Cha

  • is_block_device => is_block
  • is_char_device => is_char
  • is_socket => is_sock

Removed fs.cha_follow() in favor of fs.cha()

- local cha = fs.cha_follow(url)
+ local cha = fs.cha(url, true)

The names of builtin plugins are now reserved

Yazi comes with some builtin plugins. Before v0.3, it always checked the user's plugin directory for plugins with the same name first, and if found, it would prioritize using those.

In v0.3, this check will no longer be performed, and the builtin plugins will always be used. This effectively avoids any I/O operations to improve performance since most users always use these builtin plugins.

It also reduces the possibility of troubles - if a user has a plugin with the same name but different functionality, it will prevent the builtin plugin from working as expected.

Redesigned the UI rendering API

See #1257 for details.

@erventh

This comment was marked as off-topic.

@sxyazi
Copy link
Owner Author
sxyazi commented Jul 29, 2024

Packaging

Changed required dependency:

  • Ya - Yazi's CLI tool that enables cross-instance communication (used in yazi.nvim), and calls the builtin plugins (for example archive extraction). It should be included during packaging (cargo build --release already built it by default).

Changed optional dependencies:

@sxyazi

This comment was marked as off-topic.

@sxyazi sxyazi changed the title [WIP] Migrating to Yazi v0.3.0 Migrating to Yazi v0.3.0 Aug 1, 2024
@xtexChooser
Copy link
xtexChooser commented Aug 1, 2024

Yazi v0.3.0 added a new default-on build feature that controls whether Lua should be vendored. For distributions using patches to let Yazi use not-vendored Lua, now the patch can be replaced with --no-default-features

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 2, 2024
After three months of development, I'm excited to announce the release of Yazi 0.3 today!
This version brings a host of new features and bug fixes. Thank you to every contributor for making Yazi better and better!

This is a breaking change release, so please make sure to read:

    Migrating to Yazi v0.3.0, sxyazi/yazi#1046
    Packaging, sxyazi/yazi#1046 (comment)
    Lua API breaking changes in Yazi v0.3, sxyazi/yazi#1046 (comment)

- Mouse support

The plugin system now includes five new APIs for each component - click, scroll, touch, move, and drag to handle mouse events.
These APIs come with default implementations to cover common operations.

This also allows plugin developers to extend mouse behavior and create any functionality they desire.

See #1038 for more info, thanks to @qsdrqs for his work on this!

- New builtin extract plugin

#1321 adds a builtin extract plugin for decompressing archives, with these features:
   - Interactive password input.
   - Smart output directory selection with auto renaming.
   - Supports decompressing multiple files at once.
   - Fully async, decompression tasks can queue up and run in the background.

- Enhanced file preview

Yazi 0.3 now supports the following new format to preview:
   - Fonts
   - SVGs
   - HEIC files
   - JPEG XL files

This feature requires the optional dependency ImageMagick to enable it.

- Package manager

Yazi 0.3 introduces the new ya pack subcommand for package management, making plugin and theme updates more convenient.
This is especially important as the plugin system is not yet stable, so providing users with the ability to easily keep everything up to date is necessary.

- Redesigned Icons

#1086 redesigns the icons, bringing the following improvements:

   - Improved Matching Performance: The new dirs, files, and exts compile the icon rules into a HashMap at startup.
     This allows most icon matches to be completed with O(1) complexity, significantly enhancing performance.
   - Built-in nvim-web-devicons: This includes a richer and ready-to-use set of icons out of the box.
   - Enhanced Icon Styling: Each icon now supports specifying both dark and light colors (currently only fg_dark is used).
     In the future, the terminal color will automatically choose the appropriate color. This was added as part of #988.
   - Enhanced is Function: The original is functionality has been reimplemented as conds to allow more complex conditional expressions, such as cond = "!dir & exec".

- Significant archive preview performance improvements

#1220 reimplements archive previewing to be streamed. This means only a small amount of necessary data needs to be read to display the preview immediately,
rather than waiting for all the data to be returned and parsed as before.

Additionally, by replacing lsar with 7zip, the preview speed has been further improved. The new implementation also introduces two new features: icon display and file size display.

- Other improvements

These are a few of my favorite features. For a complete list of improvements in Yazi 0.3, check out the full changelog.

What's Changed
    feat: support yazi-cli for Nix flake by @XYenon in #944
    feat: allow building with the system Lua by @Kladki in #943
    feat: support expanding Windows paths like "D:" that only have a drive letter but no root by @sxyazi in #948
    fix: always create XDG cache directory even if user has set a custom one by @sxyazi in #956
    feat: support previewing files containing non-UTF-8 characters by @sxyazi in #958
    fix: correct the glob pattern for the icons to fit the new matching algorithm by @sxyazi in #959
    feat: add *.opus file icon by @Brixy in #967
    fix: improve accessibility by avoiding hex color code for white by @Brixy in #968
    fix: avoiding duplicate candidates in the which component by @mikavilpas in #975
    feat: detect terminal type in tmux with CSI sequence in passthrough mode by @sxyazi in #977
    feat: add more rules to [filetype] and [icon] by @Brixy in #966
    feat: re-enable the file created attribute by @rafi in #987
    feat: add --force-window option to mpv by @GOWxx in #998
    feat: close confirmation prompts and exit automatically when the ongoing task gone by @sxyazi in #997
    fix: notification title width does not include the width of the icon by @sxyazi in #1000
    feat: support cargo binstall yazi-fm and cargo binstall yazi-cli by @slowsage in #1003
    feat: yazi --debug shows ya version in its output by @mikavilpas in #1005
    feat: add git commit hash to ya --version by @fzdwx in #1006
    feat: package manager by @sxyazi in #985
    feat: ya pack displays help if no arguments are given by @mikavilpas in #1012
    feat: new --args parameter for fd an rg search by @LatentDream in #1013
    fix: correct wasm target condition by @itsjunetime in #1018
    fix: broaden file watcher event types to accommodate permission changes on certain platforms by @sxyazi in #1024
    feat: add new debounce option to ya.input() API by @sxyazi in #1025
    fix: recognize TERM=rxvt-unicode-256color by @dtolnay in #1027
    feat: support stdin and pipe for Child API by @sxyazi in #1033
    ci: consistently enforce Lua coding style by @mikavilpas in #1029
    ci: fix cargo unit tests execution by @clispios in #1041
    refactor: eliminate exec by @sxyazi in #1045
    feat: use Ctrl-c instead of Ctrl-q as the universal close key for all components by @sxyazi in #1047
    fix: remove ignore options from rg and fd search by @chriszarate in #1043
    feat: font preview by @sxyazi in #1048
    docs: add CONTRIBUTING.md by @johan-naizu in #1052
    feat: prefetcher by @sxyazi in #1061
    fix: ePUB file mime-type matching for the opener rule by @sxyazi in #1063
    fix: cursor gets out of sync occasionally at image previewing through IIP under tmux by @sxyazi in #1070
    feat: support Super/Command/Windows key notation D- by @sxyazi in #1069
    fix: remove the default keybinding for going to the temporary directory by @sxyazi in #1073
    feat!: redesign icons by @sxyazi in #1086
    fix: Sixel support from certain st forks cannot be detected by @sxyazi in #1094
    feat: support case insensitive special keys in keymappings by @mikavilpas in #1082
    refactor!: v0.3 API changes by @sxyazi in #1108
    feat: add pack --list subcommand to Ya CLI by @lpnh in #1110
    feat!: DDS client-server version check by @sxyazi in #1111
    feat: support mouse event by @qsdrqs in #1038
    feat: add some dependency version information to yazi --debug by @omagdy7 in #1112
    fix: block SIGINT signal from the spawned subprocess by @sxyazi in #1131
    feat: support completely disabling mouse with mouse_events=[]; add new cursor_blink to control cursor style of input components by @sxyazi in #1139
    fix: different filenames should be treated as the same file on case-insensitive file systems by @sxyazi in #1151
    feat: support ya sub subcommand for the Ya CLI by @mikavilpas in #1004
    fix: file watcher didn't handle realname resolution used for case-insensitive file systems correctly by @sxyazi in #1179
    feat: include file filter state in the header by @thelamb in #1182
    feat!: include the sender ID in static messages by @sxyazi in #1172
    fix: accommodate all hover events for DDS by @Xerxes-2 in #1187
    feat: support x-ndjson mime-type for JSON files by @sxyazi in #1190
    fix: suppress warnings for different name representations of the same file in the case-insensitive file system when renaming by @Xerxes-2 in #1185
    fix: ueberzug image adapter should respect the user's max_width and max_height settings by @sxyazi in #1200
    fix: magick plugin not working properly by @sxyazi in #1213
    perf!: reimplement and significantly speed up archive previewing by @sxyazi in #1220
    feat: add --hovered option to the rename and remove commands by @hankertrix in #1227
    feat: support right-click to open files by @sxyazi in #1232
    feat: support AVIF image preview by @sxyazi in #1249
    feat: ownership linemode by @AidanV in #1238
    feat: add nlink property to the Cha plugin API by @Ape in #1279
    feat: add random option to the sort command by @zooeywm in #1291
    feat: show files with inaccessible metadata by @Ape in #1275
    feat: help users migrate shell key bindings to v0.3 by @mikavilpas in #1304
    feat: allow setting YAZI_ID as a command line argument by @mikavilpas in #1305
    refactor: reimplement the signal system by @sxyazi in #1307
    fix: destroy term before stopping signals by @sxyazi in #1310
    fix: add use-dev-tty to fix piping to Yazi on macOS by @joshuali925 in #1317
    refactor: fix Clippy warnings by @Ape in #1312
    feat: add Winget publishes to CI/CD by @MoaidHathot in #1299
    feat: add support for %@ argument extension on Windows to align with Unix platforms by @sxyazi in #1319
    fix: wrong directory loading optimization condition by @sxyazi in #1331
    feat: make F1 also show the help menu by @CyberShadow in #1336
    fix: help menu multi-line text rendering by @sxyazi in #1347
    fix: can't rewatch a directory that has been deleted once before by @leihaojun in #1335
    fix(nix): add outputHashes for notify git dependency by @uncenter in #1373
    feat(nix): set VERGEN_* build env vars by @uncenter in #1375
    refactor(nix): cleanup and switch to nixfmt-rfc-style by @uncenter in #1376
    chore: bump version to 0.3 by @sxyazi in #1374
ProfOak added a commit to ProfOak/dotfiles that referenced this issue Aug 8, 2024
@saumyajyoti
Copy link
saumyajyoti commented Aug 9, 2024

Packaging

Changed required dependency:

  • Ya - Yazi's CLI tool that enables cross-instance communication (used in yazi.nvim), and calls the builtin plugins (for example archive extraction). It should be included during packaging (cargo build --release already built it by default).

Changed optional dependencies:

Hi @sxyazi
I don't see any difference in font preview with image magick installed in Yazi Windows. for different font files. All ttf files look same in preview.

Copy link
github-actions bot commented Oct 3, 2024

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants