Factor out the comp logic to a zsh comp file

This commit is contained in:
Reid 'arrdem' McKenzie 2018-01-16 11:58:42 -08:00
parent f6bfb103d1
commit 76faa1cf8f
2 changed files with 11 additions and 10 deletions

8
_goto Normal file
View file

@ -0,0 +1,8 @@
function _goto {
for label in $(_awk '{print $1}' `_gotofile`)
do
compadd "$@" $label
done
};
compdef _goto goto

View file

@ -1,4 +1,6 @@
#compdef _goto #!/usr/bin/zsh
#
# goto.zsh, a tool for bookmarking directories
function _awk { function _awk {
which awk &>/dev/null && awk $@ || \ which awk &>/dev/null && awk $@ || \
@ -46,12 +48,3 @@ function goto {
fi fi
fi fi
}; };
function _goto {
for label in $(_awk '{print $1}' `_gotofile`)
do
compadd "$@" $label
done
};
compdef _goto goto