Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Making file-patterns and tag-order work



On Mar 24, 11:18am, martin f krafft wrote:
}
} also sprach Mikael Magnusson <mikachu@xxxxxxxxx> [2017-03-24 10:19 +0100]:
} > Do you have this set too?
} > zstyle ':completion:*' group-name ''
} 
} Yes!
} 
} Now if I uncomment this, then using either form of tag- or
} group-order, I get this [...]

You obviously have some zstyles you haven't told us about, such as a
"format" style.

I tried this:

zstyle ':completion:*' completer _complete
zstyle ':completion:*:argument-rest:' file-patterns \
  '*(-/):directories:directories    (*.(ba#k|old)|*~):backup-files:"backup files" *.(l#[oa]|py[co]|zwc):compiled-files:"compiled files" *.te#mp:temp-files:"temp files" .*.sw?:vim-swap-files:"vim swap files" %p:globbed-files *:all-files'
zstyle ':completion:*' format '** %U%d%u **'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:argument*' group-order vim-swap-files directories
globbed-files files all-files backup-files compiled-files temp-files
zstyle ':completion:*:argument-rest:(all|globbed)-files' ignored-patterns \
  '((*.(ba#k|old)|*~)|*.(l#[oa]|py[co]|zwc)|*.te#mp|.*.sw?|*(-/))'

Note I've deliberately munged your group-oder to move vim-swap-files to
the front to make it obvious that something has changed.  Also note no
quotes around the list of tag names in group-order.

With your setopts:

torch% setopt
interactive
nolistambiguous
listpacked
monitor
norcs
shinstdin
zle

I get this:

torch% ls
** vim swap files **
.vimbackup.swp
** directories **
10a/     19139/   a\ \(test\)/   cat/        dumdmdum/   html/      Tt/
11a/     33460/   bar/           dir1/       fooloop@    man/       z/
18875/   a\'b/    baz/           dir\ two/   home@       nowrite/   
** backup files **
file\~
** compiled files **
compiled.a
** temp files **
dummytemp.tmp
** files **

(contents of "files" tag omitted for brevity, but it's all the directories
plus misc other files).

So it sure looks to me as if group-order is working, with the exception of
the "files" tag -- but that's because _ls passes *:files:_files explicitly
to _arguments, I think.



Messages sorted by: Reverse Date, Date, Thread, Author