There are quite a lot of zsh users that do use the new compsys (via compinit), but do not know how much it can do.
There's a compinstall function in newer versions of the shell, that does some inititalizations if the shell can't find ~/.zshrc, which is fine, but to give new users an idea of what can be done, paste this to your .zshrc:

Update: I added the _force_rehash solution, since many people seem to want it.

zmodload zsh/complist
autoload -U compinit && compinit

### If you want zsh's completion to pick up new commands in $path automatically
### comment out the next line and un-comment the following 5 lines
zstyle ':completion:::::' completer _complete _approximate
#_force_rehash() {
#  (( CURRENT == 1 )) && rehash
#  return 1	# Because we didn't really complete anything
#zstyle ':completion:::::' completer _force_rehash _complete _approximate
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
zstyle ':completion:*:descriptions' format "- %d -"
zstyle ':completion:*:corrections' format "- %d - (errors %e})"
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
zstyle ':completion:*' menu select
zstyle ':completion:*' verbose yes

After that, try: ls -<TAB><TAB>
…use your cursor keys. Yes, this is nice, indeed.

Aksesoris Mobil | Cotton Bud | GPS Tracker | Online Magazine | Atap Fiberglass

examples/compquickstart.txt · Last modified: 2015/11/25 02:50 by digitalism