Skip to content

Commit

Permalink
docs(customize): start with shell specific config syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Jul 17, 2024
1 parent 63fe24b commit 57f0eec
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions website/docs/installation/customize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,19 @@ There are two possible values the `--config` flag can handle:
- a path to a local configuration file

```powershell
oh-my-posh init pwsh --config 'C:/Users/Posh/jandedobbeleer.omp.json' | Invoke-Expression
--config 'C:/Users/Posh/jandedobbeleer.omp.json'
```

- a URL pointing to a remote config

```powershell
oh-my-posh init pwsh --config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json' | Invoke-Expression
--config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json'
```

### Get inspiration

The Windows and homebrew installers also bundle the **predefined configurations** ([themes][themes]). You can use the
following way to reference them directly. This will keep them up-to-date and compatible with future updates.

<Tabs
defaultValue="windows"
groupId="shell"
values={[
{ label: 'windows', value: 'windows', },
{ label: 'homebrew', value: 'homebrew', },
]
}>
<TabItem value="windows">

For example, to use the [jandedobbeleer][jandedobbeleer] theme, alter the init line like this (`powershell`):

```powershell
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/jandedobbeleer.omp.json" | Invoke-Expression
```

</TabItem>
<TabItem value="homebrew">

When using homebrew, all themes are installed alongside Oh My Posh in `$(brew --prefix oh-my-posh)/themes`.
To use any of the themes, use the following syntax (`zsh`):

```bash
eval "$(oh-my-posh init zsh --config $(brew --prefix oh-my-posh)/themes/jandedobbeleer.omp.json)"
```

</TabItem>
</Tabs>

### Config syntax
### Shell syntax

The examples below use a local path to the [jandedobbeleer][jandedobbeleer] theme, adjust the `--config` value
to reflect your use-case.
The example below use a local path to the [jandedobbeleer][jandedobbeleer] theme, adjust the `--config` value
to reflect your configuration file, local or remote.

<Tabs
defaultValue="powershell"
Expand Down Expand Up @@ -271,6 +237,40 @@ Windows user's home folder.
Inside the WSL, you can find your Windows user's home folder here: `/mnt/c/Users/<WINDOWSUSERNAME>`.
:::

### Get inspiration

The Windows and homebrew installers also bundle the **predefined configurations** ([themes][themes]). You can use the
following way to reference them directly. This will keep them up-to-date and compatible with future updates.

<Tabs
defaultValue="windows"
groupId="shell"
values={[
{ label: 'windows', value: 'windows', },
{ label: 'homebrew', value: 'homebrew', },
]
}>
<TabItem value="windows">

For example, to use the [jandedobbeleer][jandedobbeleer] theme, alter the init line like this (`powershell`):

```powershell
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/jandedobbeleer.omp.json" | Invoke-Expression
```

</TabItem>
<TabItem value="homebrew">

When using homebrew, all themes are installed alongside Oh My Posh in `$(brew --prefix oh-my-posh)/themes`.
To use any of the themes, use the following syntax (`zsh`):

```bash
eval "$(oh-my-posh init zsh --config $(brew --prefix oh-my-posh)/themes/jandedobbeleer.omp.json)"
```

</TabItem>
</Tabs>

### Adjust a theme

Maybe there's a theme you like, but you don't fancy the colors. Or, maybe there's a segment you
Expand Down

0 comments on commit 57f0eec

Please sign in to comment.