solorice/config/yazi/plugins/what-size.yazi
2025-07-16 15:34:40 +03:00
..
LICENSE Update: 2024-10-17 2024-10-18 09:09:49 +03:00
main.lua Update 2025-07-16 2025-07-16 15:34:40 +03:00
README.md Update 2025-07-16 2025-07-16 15:34:40 +03:00

what-size.yazi

A plugin for yazi to calculate the size of the current selection or the current working directory (if no selection is made).

Compatibility

what-size supports Yazi on Linux, macOS, and Windows.

OS

  • Linux since first commit
  • macOS since commit 42c6a0e (link)
  • Windows since commit 4a56ead (link)

Yazi

  • yazi 25.5.28 and onwards since commit c5c939b (link)
  • yazi 25.x-25.4.8 since commit fce1778 (link)
  • yazi 0.4.x since commit 2780de5 (link)
  • yazi 0.3.x up to commit f08f7f2 (link)

Requirements

  • du on Linux and macOS
  • PowerShell on Windows

Installation

ya pkg add pirafrank/what-size

or

DEPRECATED

ya pack -a 'pirafrank/what-size'

Usage

Add this to your ~/.config/yazi/keymap.toml:

[[mgr.prepend_keymap]]
on = [ ".", "s" ]
run  = "plugin what-size"
desc = "Calc size of selection or cwd" 

If you want to copy the result to clipboard, you can add --clipboard or -c as 2nd positional argument:

[[mgr.prepend_keymap]]
on   = [ ".", "s" ]
run  = "plugin what-size -- '--clipboard'"
desc = "Calc size of selection or cwd"
[[mgr.prepend_keymap]]
on = [ ".", "s" ]
run = "plugin what-size -- '-c'"
desc = "Calc size of selection or cwd"

Change to whatever keybinding you like.

Feedback

If you have any feedback, suggestions, or ideas please let me know by opening an issue.

Dev setup

Check the debug config here.

To get debug logs while develoing use ya.dbg() in your code, then set the YAZI_LOG environment variable to debug before running Yazi.

YAZI_LOG=debug yazi

Logs will be saved to ~.local/state/yazi/yazi.log file.

Contributing

Contributions are welcome. Please fork the repository and submit a PR.

License

MIT