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

Highlight recently created and modified entries. #1744

Closed
2 of 3 tasks
ze0987 opened this issue Oct 7, 2024 · 1 comment
Closed
2 of 3 tasks

Highlight recently created and modified entries. #1744

ze0987 opened this issue Oct 7, 2024 · 1 comment
Labels
invalid This doesn't seem right

Comments

@ze0987
Copy link

ze0987 commented Oct 7, 2024

yazi --debug output

Yazi
    Version: 0.3.3 (Arch Linux 2024-10-07)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.3 (Arch Linux 2024-10-07)

Emulator
    Emulator.via_env: ("foot-extra", "")
    Emulator.via_csi: Ok(Foot)
    Emulator.detect : Foot

Adapter
    Adapter.matches: Sixel

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":1")
    SWAYSOCK                   : Some("/run/user/1000/sway-ipc.1000.151236.sock")
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/bin/bash")
    EDITOR             : Some("nvim")
    VISUAL             : Some("nvim")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : 3.5
    ZELLIJ_SESSION_NAME: None
    Zellij version     : 0.40.1

Dependencies
    file             : 5.45
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: 2.2.3
    magick           : 7.1.1-38
    fzf              : 0.55.0
    fd               : 10.2.0
    rg               : 14.1.1
    chafa            : 1.14.2
    zoxide           : 0.9.6
    7z               : 17.05
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1

Please describe the problem you're trying to solve

Changing the sorting method every time we look for recent entries may not be ideal.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

In directories with few items (that usually fit on the screen), highlighting recent entries makes finding them much more convenient than changing the sorting method.

Additional context

nnn implementation: jarun/nnn@d66492a

nnn.mp4

Validations

  • I have searched the existing issues/discussions
  • The latest nightly build of Yazi doesn't already have this feature
@ze0987 ze0987 added the feature New feature request label Oct 7, 2024
@sxyazi
Copy link
Owner

sxyazi commented Oct 8, 2024

It's a feature that's already supported - Yazi provides the linemode API, so you can easily implement it through the plugin system:

function Linemode:my_mtime()
  local time = math.floor(self._file.cha.modified or 0)
  local line
  if time == 0 then
    line = ui.Line {}
  else
    line = ui.Line(os.date("%b %d %H:%M", time))
  end
  if time ~= 0 and ya.time() - time <= 300 then
    line = line:reverse()
  end
  return line
end

screenshot-002068

Doc of linemode: https://yazi-rs.github.io/docs/configuration/yazi#manager.linemode

@sxyazi sxyazi closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
@sxyazi sxyazi added invalid This doesn't seem right and removed feature New feature request labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants