On MacOS Big Sur 11.3, here is my .zshrc
. I would like to get the newest files or directories near to the prompt (sorted from the most recent up to the oldest ones).
For the moment, I make test with the following command alias of ls
:
The issue is that when I press TAB after a "l" which is actually the alias:
alias l='grc -es --colour=auto ls --color -Gh -C -lrt'
grc
is a tool to colorify the files.
Here my current config in ~/.zshrc
:
# ZSH completion
autoload -Uz compinit
compinit
# Colorize completions using default `ls` colors.
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
# Zsh reverse auto-completion
zmodload zsh/complist
# To get new binaries into PATH
zstyle ':completion:*' rehash true
# Completion
zstyle ':completion:*:complete:(ls|cd|cp|mv|vim|cat|more|tail|head|open):*' file-sort date reverse
bindkey '^[[Z' menu-complete
If I do a FIRST l + space + TAB
, I have the following suggestion :
If I type a SECOND pushing on TAB
, I want a correct listing ordered from oldest to newest files automatically like this :
Finally, I want that a THIRD TAB
pushing suggests the most recent file or directory (that I can browse with SHIFT + TAB)
in my case from figure above, the first suggestion that should appear is filenme_2
.
But currently, the first suggestion with a THIRD TAB
is the oldest one : this is not what I want.
Maybe there is something to do like adding :
bindkey '^\t' reverse-menu-complete
or something slightly different but I can't succeed since with this bindkey, I have the suggestion as soon as I have pushed the FIRST TAB
.