Article 596BY zsh - extend zsh completion

zsh - extend zsh completion

by
blueray
from LinuxQuestions.org on (#596BY)
You can see from the following screenshot that my `git ls-files -m` output is only `book-urls.txt`. I mean it is the only modified file.

Attachment 34327

Now `git diff HEAD ` suggest `Completing tree file` (which list all the files). I want to place `Completing modified files` (the output of `git ls-files -m`) at the top as suggestion.

I used:

zstyle :completion::complete:git-diff:argument-rest: group-order files
zstyle :completion::complete:git-difftool:argument-rest: group-order files

To put `Completing tree files` on the top of the suggestions.

However, I am not understanding how to append the output of `git ls-files -m` as suggestion to the existing suggestions.

I am almost positive that I have to do something like:

_git-diff 2>/dev/null
functions[_git-diff-orig]=$functions[_git-diff]

_git-diff() {
_git-diff-orig "$@"
...
}

However, I am not sure what to replace `...` with.

Just to be clear, I also tried `zstyle ':completion::complete:git-difftool:argument-rest:' command 'git ls-files -m'`. Apparently doing nothing.
Attached Thumbnailsattachment.php?attachmentid=34327&stc=1& latest?d=yIl2AUoC8zA latest?i=ja0LyQdcvCU:iLpBHYpS4Cc:F7zBnMy latest?i=ja0LyQdcvCU:iLpBHYpS4Cc:V_sGLiP latest?d=qj6IDK7rITs latest?i=ja0LyQdcvCU:iLpBHYpS4Cc:gIN9vFwja0LyQdcvCU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments