Apr 29, 2018 Guys at work use Mac's with oh-my-zsh and boy that made me pretty jealous. It was not that straightforward to make it all work though. So hopefully, this post will help me and others in the future. Here's what we are going to do: Enable WSL on Windows 10; Install zsh + oh-my-zsh; Configure zsh and oh-my-zsh; Change Themes and colors. Setting Up Oh-my-zsh Now let's add a manager to handle plugins, updating and themes. It's Awesome that you have reached soo far, we are very close to completion. Great Work ? Install oh-my-zsh the manual way, Run the lines one by one.
This post explains how to have posh-git prompt style in Oh My Zsh theme on Mac.
After 4 years of using Windows, I am coming back to using a Mac. And there are so many things in Windows I am missing already. One of these things is posh-git; I loved how in one glance to your prompt you know the status of your git repo: how many files changed, how many added, how many deleted, how many indexed… just love it!
Once I moved to Mac, I changed my shell to use zsh using Oh My Zsh due to the rich experience it brings to the terminal. I was delighted to see all these themes and plugins, and then started looking for a theme that provided the same information posh-git prompt provided. To my surprise, there was none! So I started my quest to see how I can change zsh, the theme, or the plugin to have such prompt.
Being lazy, I wanted change an existing theme I like with the least amount of investment. I looked in the documentation to see how I could do that, and found the customisation wiki page:
Should I override the theme?
Oh My Zsh Macos Catalina
Overriding the theme seemed to be the perfect solution, however, there were couple of drawbacks:
Mac Zsh Oh My Zsh
When you override a theme, you override the theme, period! This means that if the author changes something after you have overridden it, you will not get these new changes.
It was a little bit too much for me to grasp! When I looked at avit theme as an example, I had questions like what is PROMPT and PROMPT2? What are all these special characters? Where is the reference/documentation to all of these? Are they theme-specific, or are they part of zsh theme reference?
Remember I wanted to put the least amount of effort, and I surely didn’t want to learn the whole thing! But while looking into avit theme, one thing grasped my attention: there was a clear reference to what seemed to be like a function git_prompt_info. And I thought this should be it, if I could find where this function is and how to override it.
To my luck, it was mentioned as an example in the customisation wiki page as an example!
Override the internals it is!
Ok great, now I know that I can customise git_prompt_info, all what I need is to mimic whatever posh-git does in that function!
Oh My Zsh For Mac
So I hit google duckduckgo again on the hope that someone already did this, and oh my! I found that there is already a port of it on bash. That’s great, now what should I do? Replace the call of prompt_git_info in the theme with a call to __posh_git_ps1? Or should I call it from prompt_git_info? Since prompt_git_info is an internal lib function, it is probably used in many themes, thus it will make sense to just call __posh_git_pst from within. And to my good surprise, there is a GitHub issue in the posh-git-bash repo that discusses integrating with zsh, it’s even referenced in the main README.md file of the repo.
Oh My Zsh Macos Install
Initially I mistakenly called the __posh_git_ps1 function, but I soon realised that I need to print (echo) the git info just like prompt_git_info did rather than changing any variables, for that I should use the __posh_git_echo.
And thus I ended up with a file called emad-git-prompt.zsh under the path ~/.oh-my-zsh/custom with the content of posh-git-bash here, and at the end of the file I wrote the following code:
Oh My Zsh For Mac Windows 10
I hope this helps you 🙂
Cars: Fast as Lightning is a racing game set in the world of the movie Cars, where you can drive your own car against any of the characters from the film, including, of course, Lightning McQueen himself. Gameplay in Cars: Fast as Lightning is different from most 3D racing games in that you don't have to control the direction, only the speed. Lightning McQueen is back - with big-time stunts and adrenaline racing action! Play Cars: Fast as Lightning for free on the App Store, Google Play, and Windows Phone today! Cars fast as lightning game.