Powerlevel9k: Conflict with vi-mode default plugin

Created on 2 Jul 2019  路  7Comments  路  Source: Powerlevel9k/powerlevel9k

This issue is the same as #319, but it's still a root of problems. The oh_my_zsh.sh firstly sources the used plugins, in this case vi-mode plugin, which defines the widget zle-keymap-select. After that, the zsh theme (in our case the powerlevel9k) is sourced and the widget zle-keymap-select is then overridden, breaking part of the vi-mode plugin. Three solutions come to my mind:

  1. make a pull request to oh-my-zsh to invert the source order, so the plugins files are the last things to be sourced;
  2. remove the zle-keymap-select from powerlevel9k.zsh-theme file
  3. manually source the plugin at the end of your .zshrc

Most helpful comment

But for this issue in specific, I believe the most adequate solution is for the oh-my-zsh to change the order of their sourcing files.

This is a bug in powerlevel9k and it can be fixed. I know it because I've fixed it in my fork.

All 7 comments

How is .zshrc configured to fix the conflict and insure a working vi_mode indicator?

This following configuration does not work for me when using powerlevel9k release v0.6.7

source $ZSH/oh-my-zsh.sh

# Fix for vi-mode indicator on powerlevel9k
source $ZSH/custom/plugins/vi-mode/vi-mode.plugin.zsh

It's been almost a year and this is still a problem. The workaround I've been using since then is to source custom plugins manually at the end of the ~.zshrc file. Just make sure source $ZSH/custom/plugins/vi-mode/vi-mode.plugin.zsh is the last line. Also I'm using a modified vi-mode plugin; I upgraded it to change the cursor shape according to the mode. Check my dotfiles here: https://github.com/freddieoliveira/dotfiles

It's been almost a year and this is still a problem.

If it's any consolation, there's been no commits in the last year: https://github.com/Powerlevel9k/powerlevel9k/graphs/commit-activity. This doesn't help with your issue but at least you know it's not being deprioritized compared to other issues.

Oh, it's a shame the development was put on hold, I didn't know that. But for this issue in specific, I believe the most adequate solution is for the oh-my-zsh to change the order of their sourcing files. The custom plugins must have priority over the system ones. They already ensure this with the command alias:

Set personal aliases, overriding those provided by oh-my-zsh libs, plugins, and themes

But they fail to do the same with the plugins. I'll open an issue there about this.

But for this issue in specific, I believe the most adequate solution is for the oh-my-zsh to change the order of their sourcing files.

This is a bug in powerlevel9k and it can be fixed. I know it because I've fixed it in my fork.

I tried your powerlevel10K plugin. It indeed fixes this bug, now I can add vi-mode plugin in the intended way. No workarounds needed anymore. Also it is waaaaayy faster than powerlevel9K, and I got 100% compatibility with my previous config as simple as that. Just needed to add POWERLEVEL9K_LEGACY_ICON_SPACING="true" and ZLE_RPROMPT_INDENT=0. Simply amazing dude!

I second @FreddieOliveira's remarks. Just installed powerlevel10k quick and painless with no issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gipert picture gipert  路  5Comments

agungsetiawan picture agungsetiawan  路  6Comments

hackerwin7 picture hackerwin7  路  4Comments

shibumi picture shibumi  路  5Comments

mingrammer picture mingrammer  路  4Comments