Skip to content

Instantly share code, notes, and snippets.

@CirKu17
Created February 18, 2013 15:30
Show Gist options
  • Select an option

  • Save CirKu17/4978215 to your computer and use it in GitHub Desktop.

Select an option

Save CirKu17/4978215 to your computer and use it in GitHub Desktop.
# tab completion zsh
function _to_zsh {
\compadd - "$(_to words[@] $CURRENT)"
}
# setup tab completion
if [ "$ZSH_VERSION" ]; then
\compinit # TODO test if this works
# \bashcompinit # TODO test if this works
# "$TO_COMPLETE" -o filenames -o nospace -F _to_zsh to
else
# "$TO_COMPLETE" -o filenames -o nospace -F _to_bash to
fi
_to() { _arguments "-b [bookmark]" "-r [remove bookmark]" "*: :(a_bookmark another_bookmark)"; }
compdef _to to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment