powerlevel10k: oh-my-zsh plugins are not working with p10k

Hello, adding plugins on ~/.zshrc like git doesn’t work and does nothing. I wanted to use the alias from the git plugin. Without p10k this works. Can you guys help me out?

#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

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


# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh


# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git ZSH-Syntax-highlighting common-aliases)

source $ZSH/oh-my-zsh.sh

source ~/powerlevel10k/powerlevel10k.zsh-theme

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# alias gtp="cd projects"

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

# Increases the movement speed of cursor
xset r rate 190 35

# FZF with fd library
# For key bindings sourced fzf key binding with the instructions from command "apt-cache show fzf"
source /usr/share/doc/fzf/examples/key-bindings.zsh
#Append this line to ~/.zshrc to enable fuzzy auto-completion for Zsh:
source /usr/share/doc/fzf/examples/completion.zsh
# For only files you can use it like `fdfind --type f`
export FZF_DEFAULT_COMMAND='fdfind --color=always --exclude .git'
export FZF_DEFAULT_OPTS="--ansi"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"

# nvm

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

#hide warning and stars zsh prompts quickly
#typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (10 by maintainers)

Most upvoted comments

I had the same problem, all you need to do is to add this line before the plugins block

source ~/.oh-my-zsh/plugins/git/git.plugin.zsh

I’ve found the root cause.

MacOs 
-> setup oh-my-zsh 
-> adding z plugin as `plugins=(git docker z history)`
-> setup p10k !!! through Homebrew https://github.com/romkatv/powerlevel10k#homebrew
-> configure p10k as `p10k configure`
= 
z plugin STOP work
MacOs 
-> setup oh-my-zsh 
-> adding z plugin as `plugins=(git docker z history)`
-> setup p10k !!! through https://github.com/romkatv/powerlevel10k#oh-my-zsh
-> configure p10k as `p10k configure`
= 
z plugin WORK

That’s another way to solve the problem.

If I remove the line source ~/powerlevel10k/powerlevel10k.zsh-theme from ~/.zshrc and restart my terminal, alias gst works. If I add that line back and restart my terminal, alias gst does not work.

Please record and post a video of your doing this ☝️

oh Sorry, Exactly what do you want answers for?

  1. Which alias doesn’t work?
  2. How are you checking whether it works or not?
  3. Which changes do you need to make to .zshrc you’ve posted earlier to make it work?

You’ve already answered the first question – alias gst does not work. Could you answer the remaining two questions? You don’t need to provide any other information.

Here’s how an answer to the question number 2 might look like:

To check whether gst works I type gst and press Enter. If I get “zsh: command not found: gst”, then I conclude that it doesn’t work. If I get the same output as from git status, I conclude that the alias works.

Here’s how an answer to the question number 3 might look like:

If I remove the line source ~/powerlevel10k/powerlevel10k.zsh-theme from ~/.zshrc and restart my terminal, alias gst works. If I add that line back and restart my terminal, alias gst does not work.

Which alias? How are you checking whether it works? Which changes do you need to make to .zshrc you’ve posted earlier to make it work?