ftblog

:: widerstand zwecklos ::
email jabber gpgkey
hackergotchi

June 24, 2006

Tooltime: zsh #7

Filed under: tooltime -- 01:14

zsh - completion quickstart

Das die zsh eh die geilste Shell ist, ist ja sowieso klar.
Da einem immer wieder Anfänger über den weg laufen, die die geile Kompletierung
nicht eingeschaltet haben, gibt's hier mal eben ein kleines Schnipsel zsh Code,
der als Quickstart dienen soll. (weitere Informationen in 'man zshcompsys'):

zmodload zsh/complist
autoload -U compinit && compinit
zstyle ':completion:::::' completer _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:*' menu select
zstyle ':completion:*' verbose yes

Danach einfach mal 'ls -<TAB><TAB>' eingeben und glücklich sein. :)
(Ja, man kann die Cursortasten zur Auswahl benutzen...)
Das ist natürlich nur ein Anfang, das System kann viel viel mehr.

Powered by zblog
valid css | valid xhtml | utf-8 encoded | best viewed with anybrowser