Customize
The standard initialization sets Oh My Posh' default theme. This configuration is downloaded
and kept up-to-date with Oh My Posh' version every time the shell starts. To change/alter the configuration, you need to
add the --config
command-line option to change the configuration to use a specific file.
#
Get inspirationThe best place to get started is by looking at the themes, as these are predefined configurations to use/alter.
To change to for example the jandedobbeleer theme, alter the Oh My Posh init
line to the following (assuming you
downloaded the configuration file to your user's home folder):
- powershell
- cmd
- zsh
- bash
- fish
- nu
Once altered, reload your profile for the changes to take effect.
Once altered, restart cmd for the changes to take effect.
Once altered, reload your profile for the changes to take effect.
Once altered, reload your profile for the changes to take effect.
Once altered, reload your config for the changes to take effect.
warning
Oh My Posh requires Nushell >= 0.60.0
Edit $nu.configuration/path
and add the following lines at the bottom.
If you want to save the initialization script elsewhere, replace the lines above with these:
Once altered, restart nu shell for the changes to take effect.
wsl
When using oh-my-posh in Windows and the WSL, know that you can share your theme with the WSL by pointing to a theme in your Windows user's home folder.
Inside the WSL, you can find your Windows user's home folder here: /mnt/c/Users/<WINDOWSUSERNAME>
.
remote config
The --config
flag can accept either a local filepath or a remotely hosted config file.
For example, the following is a valid --config
flag:
#
Export the current themeMaybe there's a theme you like, but you don't fancy the colors. Or, maybe there's a segment you want to tweak/add, or replace some of the icons with a different one. Whatever the case, read through available options first, by starting with the configuration guide.
You can export the current theme (default, or set via --config
) to the format you like (json
or toml
)
which can be used to tweak and store as your own custom theme.