summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2008-12-12 22:02:05 +0100
committerFlorian Pritz <f-p@gmx.at>2008-12-12 22:02:05 +0100
commitdf4e95d196a430bbb6ee165787743d49927dc6de (patch)
tree5fba3f731006ea39557ad382bee72b9fe93e8500
parent0a875abacc5c875956c5b5d8a0e6ec8cbf740ab7 (diff)
downloaddotfiles-df4e95d196a430bbb6ee165787743d49927dc6de.tar.gz
dotfiles-df4e95d196a430bbb6ee165787743d49927dc6de.tar.xz
added completition for ssh-mount
-rw-r--r--.zshrc22
1 files changed, 15 insertions, 7 deletions
diff --git a/.zshrc b/.zshrc
index d657943..0eff85f 100644
--- a/.zshrc
+++ b/.zshrc
@@ -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