oh-my-posh/docs/docs/install-windows.mdx
2021-12-19 11:33:38 +01:00

198 lines
4.7 KiB
Plaintext

---
id: windows
title: Windows
sidebar_label: ⊞ Windows
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Shells from "./install-shells.mdx";
import Customize from "./install-customize.md";
import CustomizeCmd from "./install-customize-cmd.mdx";
## Setup your terminal
While Oh My Posh works on the standard terminal, we advise using the [Windows Terminal][wt].
:::info
To display all icons, we recommend the use of a [Nerd Font][fonts].
:::
## Install
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'powershell', value: 'powershell', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
```powershell
winget install JanDeDobbeleer.OhMyPosh
```
</TabItem>
<TabItem value="scoop">
```powershell
scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
```
</TabItem>
<TabItem value="powershell">
```powershell
Install-Module oh-my-posh -Scope CurrentUser
```
:::warning
The PowerShell module only installs the Oh My Posh executable inside PowerShell, to use Oh My posh outside of PowerShell
(bash, cmd, ...), add the following folder to your `$PATH`:
```powershell
$env:POSH_PATH
```
:::
</TabItem>
<TabItem value="chocolatey">
:::info
The chocolatey package is managed by [Curtis Carter][cc]. In case of problems, please create an issue [here][cc-choco].
:::
```powershell
choco install oh-my-posh
```
</TabItem>
</Tabs>
This installs a couple of things:
- `oh-my-posh.exe` - Windows executable
- `themes` - The latest Oh My Posh [themes][themes]
For the `$PATH` to reload, a restart of your shell session is advised.
## Update
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'powershell', value: 'powershell', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
```powershell
winget upgrade JanDeDobbeleer.OhMyPosh
```
</TabItem>
<TabItem value="scoop">
```powershell
scoop update oh-my-posh
```
</TabItem>
<TabItem value="powershell">
```powershell
Update-Module oh-my-posh
```
</TabItem>
<TabItem value="chocolatey">
```powershell
choco upgrade oh-my-posh
```
</TabItem>
</Tabs>
## Replace your existing prompt
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'powershell', value: 'powershell', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
You can find the themes winget installs inside the `~\AppData\Local\Programs\oh-my-posh\themes\` folder.
To use `jandedobbeleer.omp.json` for example, you can refer to it using `~\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json`
when setting the prompt using the `--config` flag.
</TabItem>
<TabItem value="scoop">
You can find the themes scoop installs inside the `"$(scoop prefix oh-my-posh)\themes\"` folder.
To use `jandedobbeleer.omp.json` for example, you can refer to it using `"$(scoop prefix oh-my-posh)\themes\jandedobbeleer.omp.json"`
when setting the prompt using the `--config` flag.
</TabItem>
<TabItem value="powershell">
You can find the themes PowerShell installs inside the `$env:POSH_THEMES_PATH` folder.
To use `jandedobbeleer.omp.json` for example, you can refer to it using `"$env:POSH_THEMES_PATH\jandedobbeleer.omp.json"`
when setting the prompt using the `--config` flag.
</TabItem>
<TabItem value="chocolatey">
You can find the themes winget installs inside the `~\AppData\Local\Programs\oh-my-posh\themes\` folder.
To use `jandedobbeleer.omp.json` for example, you can refer to it using `~\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json`
when setting the prompt using the `--config` flag.
</TabItem>
</Tabs>
The guides below assume you copied the theme called `jandedobbeleer.omp.json` to your user's `$HOME` folder.
:::caution
When using oh-my-posh inside the WSL, make sure to follow the [linux](linux) installation guide.
:::
<Shells />
## Customize
<Customize />
:::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.
Inside the WSL, replace `~` with the following path: `/mnt/c/Users/<WINDOWSUSERNAME>`.
:::
<CustomizeCmd />
🎉🎉🎉
[fonts]: /docs/config-fonts
[scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal
[powershell]: https://www.powershellgallery.com/packages/oh-my-posh
[cc]: https://github.com/digitalcoyote
[cc-choco]: https://github.com/digitalcoyote/chocolatey-packages/tree/master/oh-my-posh
[linux]: /docs/linux
[themes]: /docs/themes