📔 Install Powerlevel10K on Ubuntu

📔 Install Powerlevel10K on Ubuntu
Photo by Gabriel Heinzer / Unsplash

Install Powerlevel10K 🚀

sudo apt update
sudo apt install zsh

# Install Oh My Zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Install theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k

  1. Install Zsh:

    If you don't have Zsh installed, install it using:

    sudo apt update
    sudo apt install zsh
    
  2. Install Oh My Zsh:

    Install Oh My Zsh by running the following command:

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    
  3. Install Powerlevel10k Theme:

    Clone the Powerlevel10k repository into the custom themes directory of Oh My Zsh:

    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k
    
  4. Set Zsh Theme:

    Open your ~/.zshrc file in a text editor:

    nano ~/.zshrc
    

    Find the line that begins with ZSH_THEME and change it to:

    ZSH_THEME="powerlevel10k/powerlevel10k"
    

    Save the file and exit.

  5. Install Required Fonts:

    Powerlevel10k uses special characters, so you need to install a font that includes these characters. Nerd Fonts are commonly used. Follow the instructions on the Nerd Fonts GitHub repository to install a compatible font.

  6. Configure Powerlevel10k (Optional):

    When you start a new terminal session, Powerlevel10k will offer to run a configuration wizard. Follow the instructions to customize your prompt to your liking.

  7. Restart Zsh:

    Restart your terminal or run source ~/.zshrc to apply the changes.

Now you should have Powerlevel10k installed and configured on your Ubuntu 22.04 system.

Install zsh-autosuggestions 🚀

Powerlevel10k does not change the default behavior of Zsh in terms of tab-completion; rather, it enhances and customizes the appearance of the prompt. The behavior of tab-completion is primarily controlled by the Zsh configuration.

If you want to enable suggestions during tab-completion in Zsh, you can use the zsh-autosuggestions plugin. This plugin provides fish-like autosuggestions as you type, and it works well with Powerlevel10k.

Here are the steps to install and configure zsh-autosuggestions:

  1. Install zsh-autosuggestions:

    You can install it using your preferred method. One common way is via a plugin manager like oh-my-zsh.

    If you are using oh-my-zsh, you can also manually clone the repository:

    git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
    
  2. Enable zsh-autosuggestions:

    Update your ~/.zshrc file to enable the plugin. Add or modify the plugins line to include zsh-autosuggestions.

    plugins=(zsh-autosuggestions)
    
  3. Restart Zsh or Reload Configuration:

    Either restart your terminal or run the following command to apply the changes:

    source ~/.zshrc
    

Now, as you type, you should see autosuggestions appearing based on your command history.