stevearc / oil.nvim

Neovim file explorer: edit your filesystem like a buffer
MIT License
3.4k stars 92 forks source link

feature request: mtime display format #361

Closed kekscode closed 2 months ago

kekscode commented 2 months ago

Did you check existing requests?

Describe the feature

I would like to be able to customize the display of mtime using e.g. a format string (i guess this is somehow possible in lua?)

Provide background

For my personal use case i would like to avoid alphanumeric date display in favor to something like this for example:

$> date "+%Y-%d-%m %H:%M"
2024-25-04 14:10

My personal motivation is that that i need 1) the information about the year quite often and 2) i can read fast through the time stamps when they only consist of numbers and not e.g. Apr and other strings. Also it enables for shorter mtime columns.

What is the significance of this feature?

nice to have

Additional details

No response

stevearc commented 2 months ago

If you check :help column-mtime you'll see that the mtime column can be customized with a strftime-style format. See the top of that document section for how to pass parameters to a column.

kekscode commented 2 months ago
{ "mtime", format = "%Y-%m-%d %H:%M" },

Works like a charm. Thank you!