1

Would someone help me configure my powerline9k theme for Oh My Zsh on my Mac. I am using Iterm2.

Following is my configuration so far.

ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_DISABLE_RPROMPT=true
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="▶ "
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""

And following is the output

enter image description here

how do I move the git part at the right.

Gaurang Shah
  • 11,764
  • 9
  • 74
  • 137
  • There is [powerlevel10k](https://github.com/romkatv/powerlevel10k/) now. It'll give you the same prompt but 10 times faster. It recognizes the same configuration options as powerlevel9k, so you won't have to change your config. `git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k && sed -e 's/powerlevel9k/powerlevel10k/g' -i ~/.zshrc` – Roman Perepelitsa Aug 07 '19 at 07:05

1 Answers1

0

First remove or set to false this line:

POWERLEVEL9K_DISABLE_RPROMPT=true

Then define in your .zshrc what features you want on the left and right side. For example:

POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(vcs virtualenv vi_mode)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status ssh dir dir_writable )

The vcs feature is what gives you information about a git or hg repository. An entire configuration in your .zshrc might look something like this:

# source /usr/local/opt/powerlevel9k@0.6.3/powerlevel9k.zsh-theme
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_VI_MODE_INSERT_BACKGROUND='005'
POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND='236'
POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND='yellow'
POWERLEVEL9K_VI_MODE_NORMAL_FOREGROUND='236'
POWERLEVEL9K_VCS_GIT_GITHUB_ICON=""
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(vcs virtualenv vi_mode)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status ssh dir dir_writable)
POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_first_and_last
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
prompt powerlevel9k

For further details on what "features" can be added to the prompts, see here.

gregory
  • 10,969
  • 2
  • 30
  • 42
  • If I use this, I don't even see git branch – Gaurang Shah Aug 03 '19 at 17:42
  • I've haven't provided an entire config, just the lines that control the right and left prompt. You still need something `prompt powerlevel9k` at the end of your settings. – gregory Aug 03 '19 at 19:38
  • @GaurangShah, what specifically isn't working: (a) Moving the vcs to the left panel? (b) showing the git branch? (c) the font symbol for git branch not properly rendering? – gregory Aug 03 '19 at 21:39
  • Sorry for confustion.. I just want to move `VCS` to `Right` and that's the only thing now working. I am able to see what I have posted in pic – Gaurang Shah Aug 03 '19 at 21:42
  • @GaurangShah But, you've disabled the right prompt with: POWERLEVEL9K_DISABLE_RPROMPT=true, Remove that and add what I originally posted: both a RIGHT and LEFT prompt setting. Then inside the right prompt setting, add vcs. – gregory Aug 03 '19 at 21:45
  • 1
    @gergory Thanks... it worked.. like charm !!! is there a page where I can get what things I can show as a prompt – Gaurang Shah Aug 03 '19 at 21:52
  • @GaurangShah, Yes! There are a lot knobs to fiddle with: https://github.com/Powerlevel9k/powerlevel9k#customizing-prompt-segments -- IMO, documentation is quite good. – gregory Aug 03 '19 at 22:13