DEV Community 👩‍💻👨‍💻

Cover image for Enhance your macOS terminal - p10k

Posted on • Originally published at

Enhance your macOS terminal - p10k

This post was originally published at

In my previous blog post about enhancing the MacOS terminal I used the powerlevel9k theme. When I was publishing the article on as well, I was made aware there is a re-implementation of p9k available called powerlevel10k. p10k is calling itself a fast drop-in replacement for Powerlevel9k. Fast sounds always good so I thought, give it a try.

p10k is able to use the same configuration p9k is using, so if you only install p10k and change the theme in oh-my-zsh to p10k without further modifications, everything will look the same as it looked before. The only difference you might notice is that the terminal indeed behaves a little faster. This is, what I did first:

git clone --depth=1 $ZSH_CUSTOM/themes/powerlevel10k

Now where p10k is installed, it needs to be activated in the ZSH configuration:

# zsh configuration file
# Author: Thomas Bendler <>
# Date:   Tue Sep 24 20:28:27 UTC 2019
# Configure the prompt content
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator context dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time ram disk_usage ip)

# Local custom plugins
for item in $(ls -1 ${HOME}/.profile.d/*.plugin.zsh); do
  [ -e "${item}" ] && source "${item}"

After the restart of my terminal, literally, nothing has changed. It looks like the drop-in replacement part seems to be true. Let's check if we really use p10k now:

$ set | grep "__p9k_root_dir="

So far, so good. But p10k should not only be a drop-in replacement, but it also offers additional functionality that goes beyond the functionality of p9k. One thing I personally like is the fact that p10k separate the configuration from the .zshrc file per default. p10k also comes with a wizard that generates a sample configuration. I started with the lean configuration and adjusted it in a way that it fits my need. This is how my terminal now looks like:

Customized iTerm2 with p10k

The first thing I did was to clean up my .zshrc configuration file. I removed some of my oh-my-zsh plugins because I hadn't used them recently. I also added some and ended up with the following .zshrc configuration file:

# zsh configuration file
# Author: Thomas Bendler <>
# Date:   Fri Dec 27 23:48:31 CET 2019

# Add local sbin to $PATH.
export PATH="/usr/local/sbin:${PATH}"

# Path to the oh-my-zsh installation.
export ZSH="${HOME}/.oh-my-zsh"

# Use case-sensitive completion.

# Define how often to auto-update (in days).

# Enable command auto-correction.

# Display red dots whilst waiting for completion.

# Configure history stamp format

# Plugin configuration
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Add wisely, as too many plugins slow down shell startup.


# Load Zsh tools for syntax highlighting and autosuggestions
source "${HOMEBREW_FOLDER}/zsh-autosuggestions/zsh-autosuggestions.zsh"
source "${HOMEBREW_FOLDER}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"

# Load oh-my-zsh framework
source "${ZSH}/"

# Powerlevel10k configuration
[ -e ${HOME}/.p10k.zsh ] && source ${HOME}/.p10k.zsh

# Local custom plugins
for item in $(ls -1 ${HOME}/.profile.d/*.plugin.zsh); do
  [ -e "${item}" ] && source "${item}"

The important line from the p10k perspective is:

[ -e ${HOME}/.p10k.zsh ] && source ${HOME}/.p10k.zsh

This line source the p10k configuration that is stored in the .p10k.zsh file. The one that creates the layout shown in the screenshot above is the following:

Currently, the configuration file is quite big but I'm pretty sure not everything in this file is really required. It is more or less based on the generated configuration file using the lean set up. I haven't checked the default values for the configuration content yet but I could imagine a lot of configurations are default and as such, could be removed from the configuration file.

For those who want to know what this part in the .zshrc configuration file is about:

# Local custom plugins
for item in $(ls -1 ${HOME}/.profile.d/*.plugin.zsh); do
  [ -e "${item}" ] && source "${item}"

This includes my personal zsh plugins that are currently not available in other frameworks like oh-my-zsh. It seems to be a little challenge to get additional plugins included there. You can see them here:

Top comments (0)

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.