1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-14 01:40:09 +00:00
ohmyzsh/plugins/docker
2020-09-18 22:02:10 +02:00
..
_docker docker: update to latest upstream completion (92dc906) (#8835) 2020-05-23 18:33:50 +02:00
README.md docker: document option-stacking setting 2020-09-18 22:02:10 +02:00

Docker plugin

This plugin adds auto-completion for docker.

To use it add docker to the plugins array in your zshrc file.

plugins=(... docker)

A copy of the completion script from the docker/cli git repo: https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker

Settings

By default, the completion doesn't allow option-stacking, meaning if you try to complete docker run -it <TAB> it won't work, because you're stacking the -i and -t options.

You can enable it by adding the lines below to your zshrc file, but be aware of the side effects:

This enables Zsh to understand commands like docker run -it ubuntu. However, by enabling this, this also makes Zsh complete docker run -u<tab> with docker run -uapprox which is not valid. The users have to put the space or the equal sign themselves before trying to complete.

Therefore, this behavior is disabled by default. To enable it:

zstyle ':completion:*:*:docker:*' option-stacking yes
zstyle ':completion:*:*:docker-*:*' option-stacking yes