My Oh My Posh configuration I use on terminals.
To start, clone the repo
git clone https://github.com/kkaung/oh-my-posh-config
winget install Microsoft.WindowsPowershell
winget install Microsoft.Powershell
- Open Terminal
- Click dropdown chevron
- Select Settings
- Select Powershell (not Windows Powershell) as Default Profile
- Restart Terminal or open new tab
Open terminal and run
winget install JanDeDobbeleer.OhMyPosh
Oh My Posh uses special glyphs that come with certain fonts.
Download and install Caskaydia Cove Nerd Font.
To automatically run Oh My Posh with every command, we need to create/edit the profile script. To find out where it lives, type the following in Terminal
$PROFILE
This will give you a path like C:\users\me\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
. If this file does not exist, create it in this path.
Then edit the file with the following content and replace C:\my\cloned\path\
with the directory of the cloned repo path.
oh-my-posh --init --shell pwsh --config C:\my\cloned\path\oh-my-posh-config\config.json | Invoke-Expression
Go to your Terminal Settings:
- Click on Powershell under Profiles
- Go to the Appearance tab and select CaskaydiaCove NF font face
- You can also make this the default font by going to Defaults under Profiles and setting the font face under the Appearance tab
- Go to Settings
- Search for font
- Under Font Family add (in quotes)
'CaskaydiaCove NF'
Example
'CaskaydiaCoveNF', Consolas, 'Courier New', monospace
brew install zsh
To ensure we're using the zsh that we've installed, open Terminal and run
which zsh
Take the path and update Terminal Preferences > Shell opens with Command.
brew tap jandedobbeleer/oh-my-posh
brew install oh-my-posh
To automatically run Oh My Posh with every command, we need to update zsh config. Create/edit ~/.zshrc
with the following content and replace ~/my/cloned/repo
with the directory of the cloned repo path.
eval "$(oh-my-posh --init --shell zsh --config '~/my/cloned/repo/oh-my-posh-config/config.json')"
Oh My Posh uses special glyphs that come with certain fonts.
Download and install Meslo Nerd Font.
Note: You will only need to install Meslo LG M Regular Nerd Font Complete.tff
but can install different font weights and sizes if you prefer.
- Go to Settings
- Search for font
- Under Font Family add (in quotes)
'MesloLGM Nerd Font'
Example
'MesloLGM Nerd Font', Menlo, Monaco, 'Courier New', monospace