From 6012e098884d44b1e319f47f673052ce844d0c51 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Fri, 18 Mar 2022 13:15:57 +0100 Subject: [PATCH] docs: alter customize guide --- docs/docs/install-customize.mdx | 119 +++++++++++++++++++++++++++++--- 1 file changed, 111 insertions(+), 8 deletions(-) diff --git a/docs/docs/install-customize.mdx b/docs/docs/install-customize.mdx index 646fa943..291aed23 100644 --- a/docs/docs/install-customize.mdx +++ b/docs/docs/install-customize.mdx @@ -7,6 +7,112 @@ sidebar_label: 💅🏼 Customize import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +The standard prompt initialization sets Oh My Posh' [default theme][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. + +The best place to get started is by looking at the [themes][themes], as these are predefined configurations to use/alter. +To change to for example the [jandedobbeleer][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 +oh-my-posh prompt init pwsh --config ~/.jandedobbeleer.omp.json | Invoke-Expression +``` + +Once altered, reload your profile for the changes to take effect. + +```powershell +. $PROFILE +``` + + + + +```lua title="oh-my-posh.lua" +load(io.popen('oh-my-posh prompt init cmd --config ~/.jandedobbeleer.omp.json'):read("*a"))() +``` + +Once altered, restart cmd for the changes to take effect. + + + + +```bash +eval "$(oh-my-posh prompt init zsh --config ~/.jandedobbeleer.omp.json)" +``` + +Once altered, reload your profile for the changes to take effect. + +```bash +source ~/.zshrc +``` + + + + +```bash +eval "$(oh-my-posh prompt init bash --config ~/.jandedobbeleer.omp.json)" +``` + +Once altered, reload your profile for the changes to take effect. + +```bash +exec bash +``` + +Or, when using `~/.profile`. + +```bash +. ~/.profile +``` + + + + +```bash +oh-my-posh prompt init fish --config ~/.jandedobbeleer.omp.json | source +``` + +Once altered, reload your config for the changes to take effect. + +```bash +. ~/.config/fish/config.fish +``` + + + + +**Nu < 0.32.0** + +```bash +config set prompt "= `{{$(oh-my-posh prompt print primary --config ~/.jandedobbeleer.omp.json | str collect)}}`" +``` + +**Nu >= 0.32.0** + +```bash +config set prompt "(oh-my-posh prompt print primary --config ~/.jandedobbeleer.omp.json | str collect)" +``` + +Once altered, restart nu shell for the changes to take effect. + + + + :::tip 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. @@ -14,19 +120,14 @@ Windows user's home folder. Inside the WSL, you can find your Windows user's home folder here: `/mnt/c/Users/`. ::: -### Change the theme - -We downloaded all the themes and set `jandedobbeleer.omp.json` as the one to use. -However, there are [a lot more][themes] to be discovered and maybe there are some you like better. - ### Override the theme settings Maybe 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 all available options first, by starting with the [configuration guide][configuration]. -You can output the current theme to the format you like (`json`, `yaml` or `toml`) which can be used to tweak -and store as your custom theme. +You can output the current theme (default, or set via `--config`) to the format you like (`json`, `yaml` or `toml`) +which can be used to tweak and store as your own custom theme.