diff options
author | Florian Pritz <f-p@gmx.at> | 2008-12-12 22:02:05 +0100 |
---|---|---|
committer | Florian Pritz <f-p@gmx.at> | 2008-12-12 22:02:05 +0100 |
commit | df4e95d196a430bbb6ee165787743d49927dc6de (patch) | |
tree | 5fba3f731006ea39557ad382bee72b9fe93e8500 | |
parent | 0a875abacc5c875956c5b5d8a0e6ec8cbf740ab7 (diff) | |
download | dotfiles-df4e95d196a430bbb6ee165787743d49927dc6de.tar.gz dotfiles-df4e95d196a430bbb6ee165787743d49927dc6de.tar.xz |
added completition for ssh-mount
-rw-r--r-- | .zshrc | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -30,6 +30,17 @@ eval "`dircolors -b`" autoload -Uz compinit compinit +# Functions for completition +function _7slash { + if [[ $words[CURRENT] = 7(#b)(*)(#e) ]] + then + compadd -U -X 'Correct leading 7 to /' -f /$match[1] + fi +} + +function _rc () { compadd `ls /etc/rc.d/` } +function _ssh-mount () { compadd $(cat ${HOME}/bin/ssh-mount.sh | egrep "Servers:.*" | sed "s#echo \-e \"\${green}Servers\:\$NC##g; s#\"\;##g; s#,##g") } + zstyle :compinstall filename '$HOME/.zshrc' # cache results because yaourt is slow @@ -39,6 +50,10 @@ zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*' completer _complete _match _approximate _7slash zstyle ':completion:*:match:*' original only +# add completition to rc function +compdef _rc rc +compdef _ssh-mount ssh-mount.sh + # allow more mistypes if longer command zstyle -e ':completion:*:approximate:*' \ max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)' @@ -313,13 +328,6 @@ leaf(){ disown leaf } -function _7slash { - if [[ $words[CURRENT] = 7(#b)(*)(#e) ]] - then - compadd -U -X 'Correct leading 7 to /' -f /$match[1] - fi -} - function swap() { if [ "$1" = "" ] || [ "$2" = "" ] || [ "$1" = "-h" ]; then |