zsh-users
 help / color / mirror / code / Atom feed
From: Andy Spiegl <zsh.Andy@spiegl.de>
To: zsh-users@zsh.org
Subject: Re: How to tweak the format of file-list completion?
Date: Mon, 28 Dec 2020 23:58:24 +0100	[thread overview]
Message-ID: <X+pjECTJdDqMivl0@spiegl.de> (raw)
In-Reply-To: <CAH+w=7brk=qgdWhtZOKYdroELG7cGqgLi=q-k4g3yq0bd4=7tA@mail.gmail.com>

On 2020-12-20, 14:21, Bart Schaefer wrote:

> For the nonce you will have to copy Completion/Unix/Type/_list_files
> into an earlier slot in your $fpath and edit the format string that is
> passed to "zstat"
Found it, thanks!
I changed these two statements:
  zstat -s -H stat -F "%b %e %H:%M" - "$dir$f" >/dev/null 2>&1
  listfiles+=("$stat[mode] ${(l:3:)stat[nlink]} ${(r:8:)stat[uid]} ${(r:8:)stat[gid]} ${(l:8:)stat[size]} $stat[mtime] $f")

to

  zstat -s -H stat -F "%Y-%m-%d %H:%M" - "$dir$f" >/dev/null 2>&1
  listfiles+=("$stat[mode] ${(r:8:)stat[uid]} ${(r:8:)stat[gid]} ${(l:10:)stat[size]} $stat[mtime] $f")

A lot better now!
Does zstat have an option to output the file size in "human readable" format, by any chance?
Like "ls -h".

> A more complete update would be to permit that format to be assigned
> in a zstyle.  The question is whether to do it like
Very cool!  I'd be happy with any of these options.

Thanks!
 Andy


-- 
 Every person takes the limits of their own field of vision for the limits of the world.
   (Arthur Schopenhauer)


  parent reply	other threads:[~2020-12-28 23:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20 18:37 Andy Spiegl
2020-12-20 22:21 ` Bart Schaefer
2020-12-20 23:37   ` Andy Spiegl
2020-12-28 22:58   ` Andy Spiegl [this message]
2020-12-30 22:14     ` Bart Schaefer
2021-01-02 23:01       ` Andy Spiegl
2021-01-02 23:16         ` Lawrence Velázquez
2021-01-02 23:23           ` Andy Spiegl
2021-01-03  0:11             ` Bart Schaefer
2021-01-03 18:06               ` Andy Spiegl
2021-01-04  5:40                 ` [OT] " Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X+pjECTJdDqMivl0@spiegl.de \
    --to=zsh.andy@spiegl.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).