DEV Community

Cover image for πŸ’» My MacOS Shell Setup = Zsh + OhMyZsh + PowerLevel10k + tmux + nvim πŸ€“πŸ˜Ž
Emil-AAB
Emil-AAB

Posted on • Updated on

πŸ’» My MacOS Shell Setup = Zsh + OhMyZsh + PowerLevel10k + tmux + nvim πŸ€“πŸ˜Ž

Have you ever thought how boring is a pre-installed MacOs Terminal shell?
Since I have jumped into a development I have been optimizing my shell setup till now and want to present you my setup, that can serve you as inspiration. The only dependency is Zsh ➑️ Oh-My-Zsh ➑️ PowerLevel10k. tmux gives you windows splitting, session management and many more. nvim is a superset of vim (can be the most productive text editor for me, but still practicing it).

Screenshot of my Shell Setup

First of all you don't have to use the preinstalled Terminal emulator (which is an emulator of the shell, no more, no less).

There is a better version called iTerm2. Check on it here: https://iterm2.com

Installation

  • Installation is super easy over Brew package manager (hope you have it! otherwise proceed first with https://brew.sh): brew install --cask iterm2

  • Install zsh, again with brew: brew install zsh

  • You should probably run zsh to activate it in your session. The script from step 2 should take care about setting up zsh as your default shell.

  • Install Oh-my-zsh, which is great project from Robby Russel by running this command:

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode
  • The last step in installation is getting powerlevel10k (which is a fork of the famous powerlevel9k).
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Enter fullscreen mode Exit fullscreen mode

Then next steps are more about configuration:

  • You need to change the default Oh-my-zsh theme in ~/.zshrc
    If you are you using Finder and can't see it unhide hidden files with Shift+Cmd+.
    find ZSH_THEME and replace the whole line with
    ZSH_THEME="powerlevel10k/powerlevel10k"

  • Activate the new configuration by sourcing the .zshrc by source ~/.zshrc

  • Now the Configuration Wizard of PowerLevel10k should be started. Otherwise run p10k configure manually.

  • You should install the Meslo Nerd Font πŸ€“ if not yet installed.
    Configuration steps screenshot

Configuration steps screenshot

Configuration steps screenshot

Close & Open iTerm2

  • Also make sure the font chosen in the Settings of iTerm2 (once installed):
    Configuration steps screenshot

  • Once the font is set up properly, proceed with further setting of PowerLevel10k
    Make sure you see the same symbols properly! Otherwise your font is not properly configured (manual installation brew install --cask font-meslo-lg-nerd-font). As I had no problems with the fonts I proceed mostly with Yes.
    Configuration steps screenshot

Configuration steps screenshot

Configuration steps screenshot
Here with 1:
Configuration steps screenshot

Configuration steps screenshot
I prefer the Lean version. You can choose whatever you prefer:
Configuration steps screenshot
Unicode for me.
Configuration steps screenshot

As I love colors 🎨 I proceed with 1 (256 colors)

Configuration steps screenshot

Germans 🍻 love precise time ⏰, so I proceed with 24 hours format. Choose whatever you prefer.
Configuration steps screenshot

I proceed with one-liner to have more information on my screen later. Choose whatever you prefer.
Configuration steps screenshot

Same explanation, more information on square inch. I proceed with Compact option.
Configuration steps screenshot

Here I proceed with more Icons, some of space is needed but make your life more vivid. 😊 Choose whatever you prefer.
Configuration steps screenshot

I proceed with Concise. The fluency is great for beginners, but this doesn't bring you more productivity.
Configuration steps screenshot

Was hard to decide, after trying out both, I stay with No for Transient Prompt. I have no strong opinion on both choices yet though.
Configuration steps screenshot

Instant prompt is the feature from PowerLevel10K, that gives you instant prompt while still running some background tasks, before the Shell is 100% ready. This can be advantage. Read on that here github:PowerLevel10k
You can decide later if you want to disable it, if you face problems.
The option 2 "Quiet" let you forget about the feature. The option 1 "Verbose" is gonna remind you on each lunch πŸ˜… launch. You can disable it later too. So read the manual and decide. I am opting with 2, cause I understand the consequences.
Configuration steps screenshot

Overwrite the older configuration (with back up) Yes!
Configuration steps screenshot

Ready with PowerLevel10K!
Configuration steps screenshot

If you don't see the changes, try to reload iTerm2 or source ~/.zshrc.

TMUX (Terminal Multiplexer) Installation. This is optional, as you can use iTerm2 for similar features (multi-window).

  • I proceed with brew install tmux

  • After installing it just run tmux

  • You can split windows by Ctrl+B then " for horizontal splitting or/and % for vertical splitting.

  • tmux is very powerful and has much more functions than window splitting, for example detaching sessions for background running and attaching them back. You can find a cheat sheet cheat sheet

Now Neovim.

Neovim (or Nvim) is as superset of Vim, that is great and can replace your IDE'like text editor. The requirement is that you want to ban your mouse from your desk πŸ˜…. As Nvim is not the focus of this article. I can just list the plugins i have installed.
First of all install Neovim with brew install neovim
You can find over 1300 Plugins list here Neovim plugins

  • The "beautiful"? Apple Logo with your Host data is being generated by cli tool Neofetch. Which is meanwhile deprecated and replaced by fastfetch. Just install it with brew install fastfetch and run fastfetch.

That is all for now.

As I have mentioned, the only PowerLevel10K depends on Oh-My-Zsh , which depends on Zsh. The other tools are free to install and use (or don't use) in any order.

Suggestions, optimizations, and contributions are welcome!

You can follow me here or on github: https://github.com/aktienautobahn

Thanks for your attention!

Top comments (0)