Logo

dev-resources.site

for different kinds of informations.

Enhance Your macOS Terminal with Oh My Zsh, Autosuggestions, and Powerlevel10k

Published at
1/10/2025
Categories
zsh
terminal
linux
Author
arnavsharma2711
Categories
3 categories in total
zsh
open
terminal
open
linux
open
Author
15 person written this
arnavsharma2711
open
Enhance Your macOS Terminal with Oh My Zsh, Autosuggestions, and Powerlevel10k

Introduction

As someone who spends a lot of time in the terminal, I know how powerful it can be for developers, system administrators, and tech enthusiasts like myself. The terminal provides a direct interface to the operating system, but the default experience can often feel plain and lacking in features that boost productivity and ease of use. Thankfully, I discovered tools and customizations that transformed my terminal into a visually appealing and highly functional workspace.

One of the first tools I came across was Oh My Zsh, an open-source framework that makes managing Zsh configurations incredibly easy. Zsh, or Z shell, is a powerful alternative to the default Bash shell on macOS, offering enhanced features like better tab completion, command history, and scripting capabilities. Oh My Zsh takes it a step further with a vast array of plugins and themes that have made my terminal sessions more efficient and enjoyable.

To further enhance my workflow, I added Zsh Autosuggestions. This handy tool provides intuitive command suggestions, allowing me to quickly recall and reuse commands without typing them out completely. It's been a game-changer, saving me time and reducing the repetitive strain of retyping frequent commands.

Finally, I discovered Powerlevel10k, a theme that not only makes my terminal look great but also provides a wealth of information at a glance. From showing the current git branch to displaying system load, Powerlevel10k has become an essential part of my terminal setup.

In this article, I'll walk you through how I set up Oh My Zsh on macOS, integrated Zsh Autosuggestions to improve my command-line experience, and installed Powerlevel10k to give my terminal a sleek, functional appearance. Whether you're a terminal pro or just starting out, these tools can revolutionize your command-line experience, making it more efficient, visually appealing, and tailored to your needs.


Setting Up Oh My Zsh on macOS

Step 1: Install Zsh

To get started, I first needed to ensure I had the latest version of Zsh installed. While Zsh comes pre-installed on macOS, I used Homebrew to update it to the latest version. Here's how I did it:

brew install zsh
Enter fullscreen mode Exit fullscreen mode

Step 2: Install Oh My Zsh

Next, I installed Oh My Zsh using a simple installation script. I chose to use curl, but wget works just as well:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Step 3: Set Zsh as the Default Shell

After installing Oh My Zsh, I set Zsh as my default shell:

chsh -s $(which zsh)
Enter fullscreen mode Exit fullscreen mode

I then restarted my terminal for the changes to take effect.

Step 4: Customize Oh My Zsh

I opened my .zshrc file to customize my Zsh setup, including themes and plugins:

nano ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

I set the theme to something I liked and added a few plugins to enhance my terminal's functionality. Once done, I reloaded my configuration with:

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Enhancing Zsh with Autosuggestions

Step 1: Install zsh-autosuggestions Plugin

To add autosuggestions, I cloned the zsh-autosuggestions repository into the Oh My Zsh custom plugins directory:

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Enter fullscreen mode Exit fullscreen mode

Step 2: Enable the Plugin

I then enabled the plugin by editing my .zshrc file:

nano ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

I added zsh-autosuggestions to the list of plugins:

plugins=(git zsh-autosuggestions)
Enter fullscreen mode Exit fullscreen mode

Step 3: Apply the Changes

Finally, I reloaded my Zsh configuration to activate the plugin:

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Now, I get helpful command suggestions as I type, which has sped up my workflow significantly.


Installing and Configuring Powerlevel10k

Step 1: Install Powerlevel10k

For a visually stunning terminal, I installed Powerlevel10k by cloning its repository:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
Enter fullscreen mode Exit fullscreen mode

Step 2: Set Powerlevel10k as the Theme

I then updated my .zshrc file to set Powerlevel10k as my theme:

nano ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

I changed the theme line to:

ZSH_THEME="powerlevel10k/powerlevel10k"
Enter fullscreen mode Exit fullscreen mode

Step 3: Apply the Changes

After saving the file, I reloaded my Zsh configuration:

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Step 4: Configure Powerlevel10k

The first time I loaded the theme, Powerlevel10k launched a configuration wizard that helped me customize my prompt. If the wizard didnโ€™t start automatically, I could trigger it manually with:

p10k configure
Enter fullscreen mode Exit fullscreen mode

This wizard allowed me to set up a prompt that displays essential information, making my terminal both beautiful and highly functional.


Conclusion

With Oh My Zsh, Zsh Autosuggestions, and Powerlevel10k, Iโ€™ve turned my macOS terminal into a powerful and aesthetically pleasing workspace. These tools have enhanced my productivity, made my workflow smoother, and added a personal touch to my terminal sessions. If youโ€™re looking to improve your terminal experience, I highly recommend trying these tools out for yourself.

zsh Article's
30 articles in total
Favicon
Understanding Linux Shells: Interactive, Non-Interactive, and RC Files
Favicon
Enhance Your macOS Terminal with Oh My Zsh, Autosuggestions, and Powerlevel10k
Favicon
Oh My Zsh: A Simple Guide for Developers
Favicon
Display Dir Structure in Tree Format.
Favicon
A Guide to Setting Up Zsh: Improving Your Terminal Experience
Favicon
OMZ: Some Plugins that I forget about
Favicon
Managing dotfiles using GNU Stow on macOS
Favicon
Copy paste bash command but dont understand what it does?
Favicon
How do I show the git branch with colours in Bash prompt?
Favicon
Demystifying Bash and Zsh on Mac
Favicon
How to make your terminal looks Splendid
Favicon
Adding Zsh Completion for `gh copilot`
Favicon
Docker aliases with zsh using Ohmyzsh
Favicon
Improve your PowerShell experience
Favicon
Colorful terminals with Oh My Posh and Windows Terminal
Favicon
Some Config Ideas for your ZSH
Favicon
Ma configuration post-installation d'Arch Linux
Favicon
๐Ÿš€ Simplify Your Linux Process Killing with a Fuzzy Process Killer ๐Ÿš€
Favicon
How to Remove Duplicate Paths in ZSH on MacOS
Favicon
zsh: permission denied: ./gradlew
Favicon
How to install oh-my-zsh and zsh-autosuggestions for macbook
Favicon
Add Visual Studio Code to your OSX zsh PATH
Favicon
Simple Directory Watcher to Restart Dev Server
Favicon
๐Ÿš€ Um Guia Prรกtico para Configurar Zsh, Oh My Zsh, asdf e Spaceship Prompt com Zinit para Seu Ambiente de Desenvolvimento
Favicon
๐Ÿš€ A hands-on guide to setting up zsh, oh my zsh, asdf, and spaceship prompt with zinit for your development environment
Favicon
My zsh config
Favicon
Finding Terminal Utopia
Favicon
How to stop Storybook opening a new webpage on start (automatically with zsh)
Favicon
zoxide - A faster alternative to boring cd command
Favicon
A quick bash/zsh tip

Featured ones: