Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: installing OMZP::kubectl doesn't provide completions #314

Open
3 tasks done
hellt opened this issue Apr 24, 2024 · 2 comments
Open
3 tasks done

bug: installing OMZP::kubectl doesn't provide completions #314

hellt opened this issue Apr 24, 2024 · 2 comments
Assignees
Labels
bug 🐞 Inconsistencies or issues which will cause a problem for users or implementors. no-stale 🔒 This is exempt from the stale bot triage 📑 The issue is awaiting investigation.

Comments

@hellt
Copy link

hellt commented Apr 24, 2024

Environment

Debian 12

Reproduction steps

1. install omzp::kubectl by putting `zi snippet OMZP::kubectl` in `.zshrc`
2. type `k` and press tab

Expected behavior

1. completions are displayed

Current behavior

completions are not shown, the output is:

❯ k 
(eval):1: _kubectl: function definition file not found

Code snippet

# init direnv
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#how-do-i-initialize-direnv-when-using-instant-prompt
(( ${+commands[direnv]} )) && emulate zsh -c "$(direnv export zsh)"

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

(( ${+commands[direnv]} )) && emulate zsh -c "$(direnv hook zsh)"


if [[ -r "/home/rd/.config/zi/init.zsh" ]]; then
  source "/home/rd/.config/zi/init.zsh" && zzinit
fi

# history settings
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory

# powerlevel prompt installation powered by zi (wiki.zshell.dev)
zi ice depth=1; zi light romkatv/powerlevel10k

# pyenv initialization
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

# LS colors
alias ls='ls --color=auto'
zi ice atclone'dircolors -b LS_COLORS > clrs.zsh' \
  atpull'%atclone' pick"clrs.zsh" nocompile'!' \
  atload'zstyle ":completion:*" list-colors ${(s.:.)LS_COLORS}'
zi light trapd00r/LS_COLORS

# docker completion
zi ice wait lucid; zi light greymd/docker-zsh-completion

# syntax highlighting
zi ice wait lucid; zi light z-shell/F-Sy-H

# patch dl ice modifiers that are required by some zi packages
# https://wiki.zshell.dev/ecosystem/annexes/patch-dl
zi light z-shell/z-a-patch-dl

# fzf
zi pack"binary+keys" for fzf

# gh completions
if command -v gh > /dev/null; then
  zi ice lucid wait as'completion' blockf has'gh'
  zi snippet "$HOME/.local/share/completions/_gh"
fi

# containerlab completions
if command -v containerlab > /dev/null; then
  zi ice lucid wait as'completion' blockf has'containerlab'
  zi snippet "$HOME/.local/share/completions/_containerlab"
fi

# kubectl plugin from ohmyzsh
zi snippet OMZP::kubectl

# disable highlighting pasted text
# https://forums.freebsd.org/threads/bracketed-paste.81314/#:~:text=You%20can%20also%20simply%20disable,zshrc.
zle_highlight=('paste:none')

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh


autoload -Uz compinit
compinit

zi cdreplay -q # <- execute compdefs provided by rest of plugins

Additional information

❯ zi zstatus          
Directories set: 
Home: /home/rd/.zi
Binary: /home/rd/.zi/bin
Plugin: /home/rd/.zi/plugins
Snippet: /home/rd/.zi/snippets
Service: /home/rd/.zi/services
Modules: /home/rd/.zi/zmodules
User-land: /home/rd/.zi/polaris
Completions:/home/rd/.zi/completions
Loaded plugins: 6
Light loaded: 2
Downloaded plugins: 6
Compiled plugins: 5
Enabled completions: 7
Disabled completions: 0
Completions available overall: 7
Snippets loaded: 
/home/rd/.local/share/completions/_containerlab <single file>, /home/rd/.local/share/completions/_gh <single file>, OMZP::kubectl <single file> 

Self-service

  • I'd be willing to address this documentation request myself.

Have you read the Contributing Guidelines?

Are you familiar with the Contributor Covenant Code of Conduct?

Contact Details

No response

@hellt hellt added bug 🐞 Inconsistencies or issues which will cause a problem for users or implementors. triage 📑 The issue is awaiting investigation. labels Apr 24, 2024
Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale 👻 No activity for quite some time. label May 25, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
@ss-o ss-o added no-stale 🔒 This is exempt from the stale bot and removed stale 👻 No activity for quite some time. labels Jun 23, 2024
@ss-o ss-o reopened this Jun 23, 2024
@nickcaballero
Copy link

Do completions work for kubectl? The completions for the k alias are working for me. Have you tried adding atload"zicompinit; zicdreplay"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Inconsistencies or issues which will cause a problem for users or implementors. no-stale 🔒 This is exempt from the stale bot triage 📑 The issue is awaiting investigation.
Projects
None yet
Development

No branches or pull requests

3 participants