How to extend existing zsh completion functions?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way to have both the oh my zsh plugin and my custom ant auto-completion live in harmony?



Here's the existing plugin at ~/.oh-my-zsh/plugins/ant/ant.plugin.zsh



_ant_does_target_list_need_generating () 
[ ! -f .ant_targets ] && return 0;
[ build.xml -nt .ant_targets ] && return 0;
return 1;


_ant ()
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
ant -p

compdef _ant ant


And my auto complete at ~/my_completions/_ant



#compdef ant

_arguments '-Dprop=-[properties file]:filename:->files' '-Dsrc=-[build directory]:directory:_files -/'
case "$state" in
files)
local -a property_files
property_files=( *.properties )
_multi_parts / property_files
;;
esac


And here is my $fpath



/Users/myusername/ralph_completion_fun /Users/myusername/.oh-my-zsh/plugins/git /Users/myusername/.oh-my-zsh/functions /Users/myusername/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions








share







New contributor




Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way to have both the oh my zsh plugin and my custom ant auto-completion live in harmony?



    Here's the existing plugin at ~/.oh-my-zsh/plugins/ant/ant.plugin.zsh



    _ant_does_target_list_need_generating () 
    [ ! -f .ant_targets ] && return 0;
    [ build.xml -nt .ant_targets ] && return 0;
    return 1;


    _ant ()
    if [ -f build.xml ]; then
    if _ant_does_target_list_need_generating; then
    ant -p

    compdef _ant ant


    And my auto complete at ~/my_completions/_ant



    #compdef ant

    _arguments '-Dprop=-[properties file]:filename:->files' '-Dsrc=-[build directory]:directory:_files -/'
    case "$state" in
    files)
    local -a property_files
    property_files=( *.properties )
    _multi_parts / property_files
    ;;
    esac


    And here is my $fpath



    /Users/myusername/ralph_completion_fun /Users/myusername/.oh-my-zsh/plugins/git /Users/myusername/.oh-my-zsh/functions /Users/myusername/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions








    share







    New contributor




    Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way to have both the oh my zsh plugin and my custom ant auto-completion live in harmony?



      Here's the existing plugin at ~/.oh-my-zsh/plugins/ant/ant.plugin.zsh



      _ant_does_target_list_need_generating () 
      [ ! -f .ant_targets ] && return 0;
      [ build.xml -nt .ant_targets ] && return 0;
      return 1;


      _ant ()
      if [ -f build.xml ]; then
      if _ant_does_target_list_need_generating; then
      ant -p

      compdef _ant ant


      And my auto complete at ~/my_completions/_ant



      #compdef ant

      _arguments '-Dprop=-[properties file]:filename:->files' '-Dsrc=-[build directory]:directory:_files -/'
      case "$state" in
      files)
      local -a property_files
      property_files=( *.properties )
      _multi_parts / property_files
      ;;
      esac


      And here is my $fpath



      /Users/myusername/ralph_completion_fun /Users/myusername/.oh-my-zsh/plugins/git /Users/myusername/.oh-my-zsh/functions /Users/myusername/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions








      share







      New contributor




      Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way to have both the oh my zsh plugin and my custom ant auto-completion live in harmony?



      Here's the existing plugin at ~/.oh-my-zsh/plugins/ant/ant.plugin.zsh



      _ant_does_target_list_need_generating () 
      [ ! -f .ant_targets ] && return 0;
      [ build.xml -nt .ant_targets ] && return 0;
      return 1;


      _ant ()
      if [ -f build.xml ]; then
      if _ant_does_target_list_need_generating; then
      ant -p

      compdef _ant ant


      And my auto complete at ~/my_completions/_ant



      #compdef ant

      _arguments '-Dprop=-[properties file]:filename:->files' '-Dsrc=-[build directory]:directory:_files -/'
      case "$state" in
      files)
      local -a property_files
      property_files=( *.properties )
      _multi_parts / property_files
      ;;
      esac


      And here is my $fpath



      /Users/myusername/ralph_completion_fun /Users/myusername/.oh-my-zsh/plugins/git /Users/myusername/.oh-my-zsh/functions /Users/myusername/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions






      zsh autocomplete oh-my-zsh





      share







      New contributor




      Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 mins ago









      Ralph Callaway

      1012




      1012




      New contributor




      Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Ralph Callaway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477142%2fhow-to-extend-existing-zsh-completion-functions%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.












          Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.











          Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477142%2fhow-to-extend-existing-zsh-completion-functions%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?