Trying to implement my own flag completion for java I broke the existing one. :-)

What I've done is (among others for sure) unfunction and autoload calls, to see if my module worked. I think it changed the order of loading autocompletion modules.

So, how to bring it back the way it was? Because previously _java was loaded first, now it's _java_class and I prefer the other way around. :-)

Files in question are both in standard Unix completion:

➜  ~ ll /usr/share/zsh/functions/Completion/Unix/_java*                                                                                                                                 [% 16:39:51]
-rw-r--r-- 1 root root 25K lut  7  2016 /usr/share/zsh/functions/Completion/Unix/_java
-rw-r--r-- 1 root root 693 lut  7  2016 /usr/share/zsh/functions/Completion/Unix/_java_class

Ubuntu 16.04. I'm using oh-my-zsh but I think it's zsh only, since I've not played around with oh-my-zsh here but with $fpath (just through export, so for one session) and unfunction and autoload.

  • Usually one leaves the system $fpath directories alone; instead, put any new completions in a directory listed first in $fpath. Not sure why you'd need to fiddle with unfunction and autoload... – thrig Oct 8 '17 at 15:32
  • For debugging of my _java_flags completion @thrig as per github.com/zsh-users/zsh-completions/blob/master/… – LIttle Ancient Forest Kami Oct 8 '17 at 15:35
  • Also, it was done via export so just for a session. – LIttle Ancient Forest Kami Oct 8 '17 at 15:44
  • If you've been messing around in the vendor space, one way to restore The Way Things Were would be to uninstall the package, delete anything left behind (in particular in that /usr/share/zsh/functions dir), and reinstall the zsh package. – thrig Oct 9 '17 at 13:54
  • I'll keep that in mind - but for later. The vendor space...? – LIttle Ancient Forest Kami Oct 13 '17 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.