Zsh Docker plugin not working

I have been using oh-my-zsh for a while, and the docker plugin somehow stops working for me for some reason.

I checked the ~ / .zshrc file and enabled the plugin

plugins=(git colored-man colorize github jira vagrant virtualenv pip python brew osx zsh-syntax-highlighting docker)

I checked the ~/.oh-my-zsh/plugins/docker directory and there is a _docker file _docker . However, when I type docker and press Tab, I don't get any of the autocomplete shortcuts that I used.

I can confirm that my git plugin works fine, but not the docker plugin. Tried to do exec zsh and source ~/.zshrc and restarted my terminal, but no luck.

Did I miss something?

+21
source share
6 answers

I think you may be absent between each plugin.

 plugins=(git, colored-man, colorize, github, jira, vagrant, virtualenv, pip, python, brew, osx, zsh-syntax-highlighting, docker) 

Alternatively, you can place each plugin on a separate line:

 plugins=( git colored-man colorize github jira vagrant virtualenv pip python brew osx zsh-syntax-highlighting docker ) 
+2
source

You might want to try deleting all .zcompdump-(...) files .zcompdump-(...) that you may have in your user home directory - using something like rm ~/.zcompdump* on the terminal or in some kind of file browser - and then restart the terminal. Watch it

Then see if this works.

+77
source

Oh-my-zsh does not seem to load the plugins/docker/_docker . You must add it to ~/.zshrc another way. Add these lines to the ~/.zshrc :

 fpath+=($ZSH/plugins/docker) autoload -U compinit && compinit 
+35
source

For me, this was just the case when I needed to launch Docker from the spotlight on my Mac for the first time so that Docker for Desktop could get the necessary access. The docker version worked just fine.

+1
source

The first thing to check is Make sure you add /usr/local/bin to your $ PATH variable. This can be checked from the .zshrc file, there should be a part:

 # If you come from bash you might have to change your $PATH. export PATH=$PATH:/usr/local/bin 
0
source

Follow these steps if you use oh-my-zsh and autocomplete does not work:

Step 1:

Make the following three links:

ln -s/Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion/usr/local/share/zsh/site-functions/_docker

ln -s/Applications/Docker.app/Contents/Resources/etc/docker-machine.zsh-completion/usr/local/share/zsh/site-functions/_docker-machine

ln -s/Applications/Docker.app/Contents/Resources/etc/docker-compose.zsh-completion/usr/local/share/zsh/site-functions/_docker-compose

Step 2:

Or add autoload -Uz compinit; compinit autoload -Uz compinit; compinit autoload -Uz compinit; compinit autoload -Uz compinit; compinit in .zshrc

or run echo "autoload -Uz compinit; compinit" >>.zshrc in your shell

-one
source

All Articles