sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
15.21k stars 344 forks source link

Feature requests #51

Open sxyazi opened 1 year ago

sxyazi commented 1 year ago

Bugs

Features

ThGrSoRu commented 11 months ago

I humbly request the developers of this divine project to bestow upon us: session save/restore

brimless commented 11 months ago

Hi, is there a way to run custom commands on keymaps? For example, I would like to have a keymap that extracts a zipped file.

Trying using shell <your command>, you can use number argument for selected files ($1, $2,... $* or $@ on linux, %1, %2... %* on Windows)

Hey! I have tried putting this in my keymap.toml file

    { on = [ "z", "u" ],         exec = "shell unzip $@", desc = "Unzip file" },

however, I am not sure how it's supposed to work. whenever I enter the keymap, it just opens a prompt with "unzip" and seemingly nothing happens. Also tried entering "unzip $@" in the prompt, but it gives me the 99% stuck thing. I also do select files I must be doing something wrong here?

Sorry, my bad. I just checked again, and it should be: { on = [ "z", "u" ], exec = "shell --confirm 'unzip $@'", desc = "Unzip file" },

Thanks! I got it working with unzipping files!

Now, I just have to figure out how to do the other way around and zip files together and give the zipped file a name...

sxyazi commented 11 months ago

@brimless

Now, I just have to figure out how to do the other way around and zip files together and give the zipped file a name...

Just some shell:

{ on = [ "c", "z" ], exec = """
    shell 'printf "Your Name:"; read name; zip "$name.zip" "$@"' --block --confirm
""" },

https://github.com/sxyazi/yazi/assets/17523360/3afc0088-7e34-40d4-9c03-ae23af3be63f

You can also save it as a file, and then shell "sh your-file.sh" ....

Anyway, the upcoming plugin system will allow better integration of these tasks, including the mentioned mount/umount external partitions, session save/restore. Stay tuned.

15cm commented 11 months ago

[FR] allow overriding individual keymap key bindings

The current keymap.toml contains a list of key bindings, instead of a map of {kbd => exec}. It means if users want to remap a single key, they have to override the entry with a whole list of the preset keymap. It's tedious and lead to out of sync between user keymap override and preset keymap, even if the user want to keep the whatever the up-to-date default keymap is, which is what I end up with doing for only overwriting the <Esc> in the [input] entry like this.

The request is to change the keymap to a map so that users can override indivual key bindings. An alternative is to have custom merging logic for the list of key bindings, to merge based using the on = "some kbd" as a key. Given that your keymap has the concept of vim mode and sequence, how to construct the "key" of the key map is non-trivial.


Another personal take on the preset keymap: enabling vim-mode in the input box by default is a bit too aggressive even for a vim veteran that used vim-mode everyday for couple of years. Especially, when one hit of <Esc> cannot get you out from the input box, which is counter intuitive. IMO given that in most cases ppl only type a few chars in the search/find_next input box and then either submit or cancel the input, the out-of-box experience will be better if vim mode is disabled by default (from the code this is another FR) in input box or at least figure out a way to let <Esc> cancel the input directly by default (conflict with the vim mode insert->normal tradition though, which is undesired).

sxyazi commented 11 months ago

@15cm

The current keymap.toml contains a list of key bindings, instead of a map of {kbd => exec}

Seems a dup of https://github.com/sxyazi/yazi/issues/51#issuecomment-1756487247


enabling vim-mode in the input box by default is a bit too aggressive even for a vim veteran that used vim-mode everyday for couple of years

In fact, Yazi has already provided a C-q to exit input directly from insert mode:

https://github.com/sxyazi/yazi/blob/c9178d4ab343aa03bedb607a7255f5ecc3d38098/yazi-config/preset/keymap.toml#L174

You can even go further to bind <Esc> directly to close, making it a regular input component:

    { on = [ "<Esc>" ],       exec = "close",          desc = "Cancel input" },

The issue noted an "Emacs readline keybindings for the input component" feature, once it's implemented, will allow users to use C-w to delete a word, and Ctrl-f, Ctrl-b to move around, etc., in the input.

15cm commented 11 months ago

Re the comment about the existing C-q and the ability to remap, it's true and I find it out in minutes and already made a change. The comment after the FR is more about the preference of the default behavior, which is opinionated so it depends on person. The suggestion is more for saving the impatient users from uninstalling the tool after finding the tool doesn't work as expected after hitting a sequence of key strokes.

Given that there are existing discussions on the two topics I raised and they are on the radar, we can revisit this when there is some progress there :)

LeXofLeviafan commented 11 months ago

Context: I'm working a lot in Midnight Commander, and it has a number of features making it quite convenient for many tasks. So, here's some features that I'm missing when working in yazi (v0.1.5… yes, I've seen the "early version" discaimer :slightly_smiling_face:):

I also suggest adding this as well:

LeXofLeviafan commented 11 months ago

…Oh, and maybe don't display byte size as decimal fractions? (Such as 226.0 B for a tiny text file)

magnetophon commented 11 months ago

I would like to request using the file command as a fallback preview method.

patka-123 commented 11 months ago

Maybe this is not the place, because I have no feature request. But I just wanted to say that Yazi is such a nice application in plenty of ways! Many kuddo's.

I hope you don't get burned out by all the features that are requested here.

5183nischal commented 11 months ago

Hi, I would like to request a preview dark mode. For example in lf I had the following preview for pdf and images that converted it to dark mode. Thank you! Yazi is amazing. function make_pdf { if [ "${TMP_FILE}" -ot "$1" ]; then pdftoppm -png -f 1 -l 1 -scale-to-x -1 -scale-to-y -1 -singlefile "$1" "${TMP_FILE%.png}" convert "${TMP_FILE}" -negate "${TMP_FILE}" fi }

evanjs commented 11 months ago

Image preview support in Windows Terminal would be nice WezTerm seems to work well, but I primarily use Windows Terminal It appears this might be contingient on https://github.com/microsoft/terminal/issues/5746?

jdrupal-dev commented 11 months ago

First of all, this project is awesome. I want to create an nvim plugin like https://github.com/lmburns/lf.nvim, but for yazi. However, if doesn't look like I can pass a file parameter and that file will then be selected when yazi is opened.

Is that something you are planning on implementing?

sxyazi commented 11 months ago

Hey @maxzinkus, the last "completion in the input field (for file/directory names)" in https://github.com/sxyazi/yazi/issues/51#issuecomment-1689267633 comment has been implemented now by https://github.com/sxyazi/yazi/pull/324. I'll mark this comment as resolved.

bassamsdata commented 11 months ago

thank you for this project. I'd like to suggest a new feature to enable yanking multiple files from different directories all together. like right now, if I selected multiple files from nested dirs, then yanked and pasted them in different dir, only the files that were in the last dir I was in would be pasted.

this feature would really enhance the user experience and I search if this feature already exist but couldn't find any.

thank you

sxyazi commented 11 months ago

@bassamsdata

https://github.com/sxyazi/yazi/issues/319 This RFC describes this feature, although I'm not sure how to implement it yet.

Consider: I have selected /a/b/c, /a/b, /a. Now, if I cut them to /, what will the directory structure of / look like? Will it be just /a/b/c, or /a, /b, /c, or some other situation?

We are gathering feedback from the community, so please feel free to leave any constructive comments on the RFC!

musjj commented 10 months ago

Just a small thing, but it'd be nice if <Esc> clears the currently yanked/cut files. Actually, I'm not sure how to clear it at all (other than by exiting).

sxyazi commented 10 months ago

@musjj

See https://github.com/sxyazi/yazi/pull/313, https://github.com/sxyazi/yazi/issues/319

manfred3000 commented 10 months ago

Thank you for this awesome file manager!

It would be nice to have the option to duplicate a file, e.g. pressing 'r' and then 'Enter' inside the unmodified prompt and then duplicate the file by renaming it.

Usecase: I often make temporary backups of files/scripts before editing them. Right now I have to yank/paste/rename...

ndtoan96 commented 10 months ago

Thank you for this awesome file manager!

It would be nice to have the option to duplicate a file, e.g. pressing 'r' and then 'Enter' inside the unmodified prompt and then duplicate the file by renaming it.

Usecase: I often make temporary backups of files/scripts before editing them. Right now I have to yank/paste/rename...

I think this can easily be configured as a keymap. Try { on = "B", exec = "cp $1 $1_backup", desc = "Create backup" }

manfred3000 commented 10 months ago

@ndtoan96 Thanks for the reply. Yep, I'm aware of that possibility, but then the renaming remains static, which isn't what I'm looking for.

magnetophon commented 10 months ago

@manfred3000 Maybe hop on discord and explain your use case a bit better. Is this a feature that you think more people would benefit from, if so, why?

hakan-demirli commented 10 months ago

@musjj

See #313, #319

Not just unyank but uncut or clear_all_selected is also welcome. Ranger and LF file manager do clear all yank/copy/cut registers on esc. I do not think yazi should do that by default on esc but those commands should at least exists as an option.

lucasmsoares96 commented 10 months ago

I think the best part of the ranger is missing. Mark a directory with m and then access it with '. It would be amazing if you had this support.

magnetophon commented 10 months ago

I think the best part of the ranger is missing. Mark a directory with m and then access it with '. It would be amazing if you had this support.

I missed that too at first, but the zoxide integration is quite a good substitute. Marks would still be nice to have though.

sxyazi commented 10 months ago

Thank you very much for this awesome piece of software. Would it be hard to implement sorting by file type?

Hey @v01dnu11, your feature request of "Sorting by file type" in https://github.com/sxyazi/yazi/issues/51#issuecomment-1732358619 has now been implemented by https://github.com/sxyazi/yazi/pull/405. I'll mark this comment as resolved.

I think the best part of the ranger is missing. Mark a directory with m and then access it with '. It would be amazing if you had this support.

Dup of https://github.com/sxyazi/yazi/issues/184, should be implemented through plugin once Yazi's plugin system is ready.

I missed that too at first, but the zoxide integration is quite a good substitute. Marks would still be nice to have though.

Yea zoxide will also be converted into a plugin at that time.

5183nischal commented 9 months ago

Would it be possible to add an option, maybe in the config, to invert preview of images and pdf to be gentle on the eyes? Thank you, Yazi is great!

hakan-demirli commented 9 months ago

Would it be possible to add an option, maybe in the config, to invert preview of images and pdf to be gentle on the eyes? Thank you, Yazi is great!

Rather than invert on/off option I think a 0-1 float would be better together with a grayscale option. Otherwise your eyes will be blasted by already dark images and pdfs.

sxyazi commented 9 months ago

@magnetophon:

I would like to request using the file command as a fallback preview method.

@5183nischal:

Hi, I would like to request a preview dark mode. For example in lf I had the following preview for pdf and images that converted it to dark mode. Thank you! Yazi is amazing. function make_pdf { if [ "${TMP_FILE}" -ot "$1" ]; then pdftoppm -png -f 1 -l 1 -scale-to-x -1 -scale-to-y -1 -singlefile "$1" "${TMP_FILE%.png}" convert "${TMP_FILE}" -negate "${TMP_FILE}" fi }

@5183nischal:

Would it be possible to add an option, maybe in the config, to invert preview of images and pdf to be gentle on the eyes? Thank you, Yazi is great!

@hakan-demirli:

Rather than invert on/off option I think a 0-1 float would be better together with a grayscale option. Otherwise your eyes will be blasted by already dark images and pdfs.

It's already included in https://github.com/sxyazi/yazi/pull/401, there's still some work ongoing in that PR though. When merged, it will allow users to create their own previewers in Lua in any way they like, take a look at pdf.lua.

At that point, you'll also be able to mix images and text, imagine adding a few lines of metadata above media files like images, videos, etc. (size, duration, color space, etc.), which will be very useful.

Performance was also thoroughly considered in the design; all IO in Lua is asynchronous and implemented natively in Rust - Even the entire plugin execution process is concurrent and asynchronous across threads! They are scheduled by the Yazi task system.

Thanks to Luajit, it's fast and allows us more optimization space. Now, we can control task cancellation at a finer granularity - checking if the task has been canceled before each Lua function call, before returning, and when a fixed number of instructions have executed, discarding them. This was difficult to achieve through Rust previously.

@evanjs:

Image preview support in Windows Terminal would be nice WezTerm seems to work well, but I primarily use Windows Terminal It appears this might be contingient on microsoft/terminal#5746?

Yep it requires Windows Terminal to support any kind of terminal graphics protocol.

@jdrupal-dev:

I want to create an nvim plugin like https://github.com/lmburns/lf.nvim, but for yazi. However, if doesn't look like I can pass a file parameter and that file will then be selected when yazi is opened.

This feature request has been done by https://github.com/sxyazi/yazi/issues/344, and I will mark this comment as "resolved".

@hakan-demirli:

Not just unyank but uncut or clear_all_selected is also welcome. Ranger and LF file manager do clear all yank/copy/cut registers on esc.

It has already been covered in the "advantages" section of https://github.com/sxyazi/yazi/issues/319. This RFC still has some tricky issues to address, I'll assess its feasibility after the completion of the plugin system. If it's not feasible, I'll accept this "unyank support" PR.

januz commented 9 months ago

@sxyazi First of all—this is such a fantastic project. I'm so happy that I found it after using first ranger, then lf because it already seems to address most of the issues I had with these two and seems to head towards having more and more amazing features. Great work!!

I would like to second @c02y's request for the option to display two tabs at the same time. I would especially find that useful for copy operations like two-pane file managers offer. I imagine something like

aca commented 9 months ago

Programmable configuration would be great. vifm can be configured with vimL and I found it very useful. Probably most simple use case would be something like this.

if extension is pdf {                                                                                                                        
  if darwin
    set opener = open
  else if SSH != "" 
    set opener = custom command
  else
    set opener = xdg-open
  fi
}
RioNight commented 9 months ago

Thanks for the project. ffmpegthumbnailer doesn't work on Windows, but it has ffmpeg. Is there a way to hack video file thumbnails for yazi on Windows?

theunpleasantowl commented 8 months ago

Hi, is there a way to run custom commands on keymaps? For example, I would like to have a keymap that extracts a zipped file.

Trying using shell <your command>, you can use number argument for selected files ($1, $2,... $* or $@ on linux, %1, %2... %* on Windows)

Hey! I have tried putting this in my keymap.toml file

    { on = [ "z", "u" ],         exec = "shell unzip $@", desc = "Unzip file" },

however, I am not sure how it's supposed to work. whenever I enter the keymap, it just opens a prompt with "unzip" and seemingly nothing happens. Also tried entering "unzip $@" in the prompt, but it gives me the 99% stuck thing. I also do select files I must be doing something wrong here?

Sorry, my bad. I just checked again, and it should be: { on = [ "z", "u" ], exec = "shell --confirm 'unzip $@'", desc = "Unzip file" },

This doesn't seem to work if there are spaces in the path referenced by the shell arg (i.e. $@). For example, if I pass a path wherein the directory or filename has spaces, this fails:

{ on = [ "W" ],         exec = "shell --confirm 'swww img -t outer $1'",            desc = "Feed file into swww to set wallpaper" },

If I check the command from the tasks window:

: line 1: /home/kaze/Pictures/Wallpapers/Anime: No such file or directory
error: the following required arguments were not provided:
  <PATH>

Usage: swww img --transition-type <TRANSITION_TYPE> <PATH>

For more information, try '--help'.
Exited with status code: 2
Process failed

full path:

"home/kaze/Pictures/Wallpapers/Anime Wallpapers/Konachan.com - 316329 brown_hair clouds hakurei_reimu japanese_clothes long_hair miko ofuda red_eyes ruda_(ruda_e) sky touhou.png"

Is there some elegant way to put quotes around the shell arg? Or perhaps it would make more sense for yazi to just always escape the path(s) prior to passing them as arg to the shell?

Currently, the way to escape the $1 arg properly looks like this:

`exec = 'shell --confirm "swww img -t outer \"$1\""',
TornaxO7 commented 8 months ago

Tree-View

image

Having a tree view is often useful to get an overview of the current directory.

RioNight commented 8 months ago

Can the highlighted item be lighter in the help menu? It is very hard to see it at certain screen-brightness levels. I think it is because of the default saturation or contrast levels.

Default colors on pwsh (it is hard to see "escape" in second column in blue): image

Different colors (it is hard to see all of the highlighted item): image

Edit: Also, the bottom right status is hard to see. image image

Also, this also happens to a / searched item: image

Sonico98 commented 8 months ago

I think it's been asked for already, but I would like to request for a way to resize or close the preview pane on the fly. It could be really useful when browsing directories that contain multiple files with very similar names, like here: image While the file name being shown at the bottom definitely helps, it's not the ideal way to deal with 30+ files with similar names.

Sonico98 commented 8 months ago

Is there some elegant way to put quotes around the shell arg? Or perhaps it would make more sense for yazi to just always escape the path(s) prior to passing them as arg to the shell?

Currently, the way to escape the $1 arg properly looks like this:

`exec = 'shell --confirm "swww img -t outer \"$1\""',

You can use single triple quotes exec = '''shell 'swww img -t outer "$@"' --confirm'''

sxyazi commented 8 months ago

@aca

Programmable configuration would be great. vifm can be configured with vimL and I found it very useful. Probably most simple use case would be something like this.

This means we need to build a DSL, parse and execute it, which can make things complex and slow down Yazi at the same time (imagine selecting 100 files and searching for their common opener, needing to perform this operation 100 times). If necessary, we can introduce conditional expressions similar to cond that preloaders do – fast enough and simple enough, see https://yazi-rs.github.io/docs/configuration/yazi#preloaders.

@RioNight

Thanks for the project. ffmpegthumbnailer doesn't work on Windows, but it has ffmpeg. Is there a way to hack video file thumbnails for yazi on Windows?

Just copy https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/video.lua as your ~/.config/yazi/plugins/video.yazi/init.lua and change the ffmpegthumbnailer command to ffmpeg - Yazi allows you overwrite and use your own previewer, see the docs here https://yazi-rs.github.io/docs/plugins/overview#previewer.

@theunpleasantowl

Is there some elegant way to put quotes around the shell arg? Or perhaps it would make more sense for yazi to just always escape the path(s) prior to passing them as arg to the shell?

I have plans to add a shorthand form for the shell command, such as shell --confirm "my-command arg1 arg2" being abbreviated as $ my-command arg1 arg2 or something similar, where $ represents shell --confirm "".

@RioNight

Can the highlighted item be lighter in the help menu? It is very hard to see it at certain screen-brightness levels. I think it is because of the default saturation or contrast levels.

Please use a Yazi theme that matches the colors of your terminal - Yazi's default theme cannot cater to all users, and even the colors needed by the same user in light/dark mode can vary. Not to mention that some terminals have poor default color schemes, like this https://github.com/sxyazi/yazi/issues/149#issuecomment-1798349727. Of course, if you find a color that better covers most terminals, feel free to create a PR.

@Sonico98

I think it's been asked for already, but I would like to request for a way to resize or close the preview pane on the fly. It could be really useful when browsing directories that contain multiple files with very similar names, like here:

It can be achieved through Yazi's plugin system; I've made some attempts, and it works well:

Maximize Preview

https://github.com/sxyazi/yazi/assets/17523360/4bb43f85-0696-4e93-879f-c617a96e5f46

-- ~/.config/yazi/plugins/max-preview.yazi/init.lua
return {
  entry = function(st)
    if st.old then
      Manager.layout, st.old = st.old, nil
    else
      st.old = Manager.layout
      Manager.layout = function(self, area)
        self.area = area

        return ui.Layout()
          :direction(ui.Layout.HORIZONTAL)
          :constraints({
            ui.Constraint.Percentage(0),
            ui.Constraint.Percentage(0),
            ui.Constraint.Percentage(100),
          })
          :split(area)
      end
    end
    ya.app_emit("resize", {})
  end,
}

Then bind it in your keymap.toml:

{ on = [ "T" ], exec = "plugin --sync max-preview" },

Hide Preview

https://github.com/sxyazi/yazi/assets/17523360/30557214-d0a7-409e-8702-62485a274b27

-- ~/.config/yazi/plugins/hide-preview.yazi/init.lua
return {
  entry = function(st)
    if st.old then
      Manager.layout, st.old = st.old, nil
    else
      st.old = Manager.layout
      Manager.layout = function(self, area)
        self.area = area

        local all = MANAGER.ratio.parent + MANAGER.ratio.current
        return ui.Layout()
          :direction(ui.Layout.HORIZONTAL)
          :constraints({
            ui.Constraint.Ratio(MANAGER.ratio.parent, all),
            ui.Constraint.Ratio(MANAGER.ratio.current, all),
            ui.Constraint.Min(1),
          })
          :split(area)
      end
    end
    ya.app_emit("resize", {})
  end,
}

Then bind it in your keymap.toml:

{ on = [ "T" ], exec = "plugin --sync hide-preview" },
Xuanwo commented 8 months ago

Hi, @sxyazi, I've created a tracking issue for the remote file manager at https://github.com/sxyazi/yazi/issues/611. Would you like to update the description to include it?

swaroopanand10 commented 8 months ago

Hey @sxyazi Your solution for preview hiding and maximizing works perfectly, Thanks for that, but is there a way to either make text file previews wrap around, or add some kind of horizontal scrolling for them? because this feature will help to read files with very long lines easy. Thanks for this project.

nonetrix commented 8 months ago

Not sure if +1 comments are appreciated or not, but I can't really up vote a individual feature. So +1 for managing archives as if they where directories. I don't think there is any TUI archive managers currently, so this would be great as I currently use KDE Ark which perhaps isn't ideal (definitely please correct me I'd love to use something in the time being)

To make this less of a useless comment, how will this be done exactly? I could see two paths, one is using some API probably ported over from C or native to Rust, or another is to invoke the commands from the shell. First one would be more correct and probably more ideal, but might require much more effort if said bindings don't exist for every archive format.

Feel free to hide this comment if you feel like it, I will probably delete it if you do that so it won't take up space. If anyone else feels the same way just up vote this to avoid duplicates

LinArcX commented 8 months ago

Feature request: Preview fonts in yazi. I have a bash script that you can inspire from it:

https://gist.github.com/LinArcX/446ed29ef4b4ef94a6a1bc19726aff62

LinArcX commented 8 months ago

Feature request:

Audio preview in Yazi. it's not something like: https://github.com/Sonico98/exifaudio.yazi/tree/master. since Exifaudio only is for the preview of the "metadata". I mean playing audio in the background and controlling it inside Yazi.

For instance, we can use CMD+j / CMD+k to increase volume, and CMD+H / CMD+L to move forward/backward in the audio file. and CMD/Space for pause/play.

LinArcX commented 8 months ago

Feature request:

Video preview in Yazi. for sure I'm not talking about the preview of "metadata". I mean playing video in the preview panel and controlling it inside Yazi.(maybe we can mpv?)

For instance, we can use CMD+j / CMD+k to increase volume, and CMD+H / CMD+L to move forward/backward in the video file. and CMD/Space for pause/play.

nonetrix commented 8 months ago

Feature request:

Audio preview in Yazi. it's not something like: https://github.com/Sonico98/exifaudio.yazi/tree/master. since Exifaudio only is for the preview of the "metadata". I mean playing audio in the background and controlling it inside Yazi.

For instance, we can use CMD+j / CMD+k to increase volume, and CMD+H / CMD+L to move forward/backward in the audio file. and CMD/Space for pause/play.

Interesting, not sure if this is already a feature request somewhere. But what about another option to show a sound wave as a preview like seen in Audacity? Or perhaps if it has not metadata it falls back to this

Edit: maybe also turning it into a xdg portal file picker could be possible?

LinArcX commented 8 months ago

the first version of the audio preview using mpg123: https://github.com/LinArcX/mpg123.yazi

For sure, it is just playing a hovered audio file and if you skip to other files, the audio will stop playing. I'm still searching how to move forward/backward in an audio file with mpg123.

taylo2allen commented 7 months ago

Feature Request: For my use case, I have keybindings in a separate toml file which I have a script that appends the file to a copy of my keymap.toml, can you please add a command line argument to load a different keymap.toml, theme.toml, & yazi.toml file.

analyticmind commented 7 months ago

Feature Request: In addition to file size, add a linemode option for displaying the number of files a directory contains.

I know the status bar indicates the number of files or items contained in the current directory, but it would be nice to see it without actually entering the directory, especially in the linemode area, as in Ranger.

I tried to add this myself (in both the linemode area and the status bar) by following the Tips section in the documentation, but I'm not a programmer and could only make it half work. For example, I declared the variable local precount = #cx.active.preview.folder.files inside Status:position and then added inside the appropriate Span. It shows the correct count, but if I hover over a file, the status bar disappears completely.

matchatealeaf commented 7 months ago

Feature Request: In addition to file size, add a linemode option for displaying the number of files a directory contains.

I tried to add this myself (in both the linemode area and the status bar) by following the Tips section in the documentation, but I'm not a programmer and could only make it half work.

@analyticmind Here's one way to do it for linemode:

@@ -1,24 +1,32 @@
 function Folder:linemode(area)
    local mode = cx.active.conf.linemode
    if mode == "none" then
        return {}
    end

    local lines = {}
    for _, f in ipairs(self:by_kind(self.CURRENT).window) do
        local spans = { ui.Span(" ") }
        if mode == "size" then
            local size = f:size()
            spans[#spans + 1] = ui.Span(size and ya.readable_size(size) or "")
        elseif mode == "mtime" then
            local time = f.cha.modified
            spans[#spans + 1] = ui.Span(time and os.date("%y-%m-%d %H:%M", time // 1) or "")
        elseif mode == "permissions" then
            spans[#spans + 1] = ui.Span(f.cha:permissions() or "")
+       elseif mode == "numfile" then
+           if f.cha.is_dir then
+               local handle = io.popen('find "' .. f.url .. '" -maxdepth 1 -type d,f | wc -l', "r")
+               local count = handle:read("*a") - 1
+               handle:close()
+
+               spans[#spans + 1] = ui.Span(count)
+           end
        end

        spans[#spans + 1] = ui.Span(" ")
        lines[#lines + 1] = ui.Line(spans)
    end
    return ui.Paragraph(area, lines):align(ui.Paragraph.RIGHT)
 end

Just add linemode = "numfile" under [manager] in your yazi.toml

Though this not a general solution as it uses find and wc, and so Windows user would need to use their Windows equivalents.

Would be good if there is a file:numfile() or file.cha.numfile.

analyticmind commented 7 months ago

@matchatealeaf Thank you very much! Very kind of you. I'll try that now.